jsp页面提交后显示空白求解
陇° 2019-08-16 05:55:10 inpu.JSP:
<% @ page contentType = "text/html;charset=GB2312"%>
<html>
<BODY bgcolor =yellow>
<fONT size =2>
<form action ="result.JSP" method = post name = form>
输入数字: <input type = "text" name= "number" size = 6>
<input type = "submit" value = "提交" name= "submit" >
</form>
</font>
</body>
</html>
result.JSP:
<% @ page contentType = "text/html;charset=GB2312"%>
<html>
<BODY bgcolor =cyan>
<fONT size =3>
<% string str= request.getParameter("number");
try{
double number =Double.parseDouble(str);
if(number<0){
response.setContentType("text/plain;charset =GB2312");
out.println(number +"的平方:"+(number *number));
}
else if(number>=0&&number<100){
response.setContentType("application/msword;charset =GB2312");
out.println(number +"的立方:"+(number *number*number));
}
else{
response.setStatus(404);
}
catch(exception e){
response.sendRedirect("inpu.JSP");
}
%>
</font>
</body>
</html>
编码也设置成utf-8了还是不行,哪出问题了??