e_6.jsp:
<%@ page contentType="text/html;charset=GB2312"%> <html> <body> <p>输入: <form action="tree4.jsp" method="post" name=form> <input type="text" name="boy"> <input type="submit" value="go"> </form> </body> </html>
tree.jsp:
<%@ page contentType="text/html;charset=GB2312"%> <html> <body> <% String str=request.getParameter("boy"); if(str==null){ out.print(1); } else{ out.print(2); } %> </body> </html>
我在e_6.jsp页里什么都不输为什么打印不出1,而还是打印2。难道str不为null吗?