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了还是不行,哪出问题了??
...全文
313 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
陇° 2019-08-27
  • 打赏
  • 举报
回复
引用 11 楼 爱吃鱼的ねこ 的回复:
[quote=引用 10 楼 陇°的回复:][quote=引用 9 楼 爱吃鱼的ねこ 的回复:] [quote=引用 8 楼 陇°的回复:][quote=引用 7 楼 爱吃鱼的ねこ 的回复:] [quote=引用 6 楼 爱吃鱼的ねこ的回复:][quote=引用 5 楼 陇°的回复:][quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java[/quote] 你见过这样的string?确定不是String???[/quote] 搞错了。。主页怎么改啊 大小写就string其他没问题但还是跳转后成空白啊[/quote] 找web.xml,有个welcome-file标签,改成你要默认显示的jsp页面[/quote] 改了有什么用?我这显示3个welcome-file[/quote] 删除,只留一个就可以,改成你的input.jsp[/quote] 我发现现在JSP根本就执行不了java程序片这是怎么回事??
爱吃鱼的ねこ 2019-08-22
  • 打赏
  • 举报
回复
引用 10 楼 陇°的回复:
[quote=引用 9 楼 爱吃鱼的ねこ 的回复:] [quote=引用 8 楼 陇°的回复:][quote=引用 7 楼 爱吃鱼的ねこ 的回复:] [quote=引用 6 楼 爱吃鱼的ねこ的回复:][quote=引用 5 楼 陇°的回复:][quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java[/quote] 你见过这样的string?确定不是String???[/quote] 搞错了。。主页怎么改啊 大小写就string其他没问题但还是跳转后成空白啊[/quote] 找web.xml,有个welcome-file标签,改成你要默认显示的jsp页面[/quote] 改了有什么用?我这显示3个welcome-file[/quote] 删除,只留一个就可以,改成你的input.jsp
陇° 2019-08-21
  • 打赏
  • 举报
回复
引用 9 楼 爱吃鱼的ねこ 的回复:
[quote=引用 8 楼 陇°的回复:][quote=引用 7 楼 爱吃鱼的ねこ 的回复:] [quote=引用 6 楼 爱吃鱼的ねこ的回复:][quote=引用 5 楼 陇°的回复:][quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java[/quote] 你见过这样的string?确定不是String???[/quote] 搞错了。。主页怎么改啊 大小写就string其他没问题但还是跳转后成空白啊[/quote] 找web.xml,有个welcome-file标签,改成你要默认显示的jsp页面[/quote] 改了有什么用?我这显示3个welcome-file
爱吃鱼的ねこ 2019-08-21
  • 打赏
  • 举报
回复
引用 8 楼 陇°的回复:
[quote=引用 7 楼 爱吃鱼的ねこ 的回复:] [quote=引用 6 楼 爱吃鱼的ねこ的回复:][quote=引用 5 楼 陇°的回复:][quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java[/quote] 你见过这样的string?确定不是String???[/quote] 搞错了。。主页怎么改啊 大小写就string其他没问题但还是跳转后成空白啊[/quote] 找web.xml,有个welcome-file标签,改成你要默认显示的jsp页面
陇° 2019-08-20
  • 打赏
  • 举报
回复
引用 7 楼 爱吃鱼的ねこ 的回复:
[quote=引用 6 楼 爱吃鱼的ねこ的回复:][quote=引用 5 楼 陇°的回复:][quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java[/quote] 你见过这样的string?确定不是String???[/quote] 搞错了。。主页怎么改啊 大小写就string其他没问题但还是跳转后成空白啊
爱吃鱼的ねこ 2019-08-17
  • 打赏
  • 举报
回复
引用 2 楼 陇°的回复:
[quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 想不通你这个逻辑,保存result.jsp文件有什么用啊😂,你打开就是那个页面的HTML文档,里面给你写个结果,你直接输出到页面就好了呀,何必这么麻烦呢
爱吃鱼的ねこ 2019-08-17
  • 打赏
  • 举报
回复
引用 2 楼 陇°的回复:
[quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp
爱吃鱼的ねこ 2019-08-17
  • 打赏
  • 举报
回复
引用 6 楼 爱吃鱼的ねこ的回复:
[quote=引用 5 楼 陇°的回复:][quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java[/quote] 你见过这样的string?确定不是String???
爱吃鱼的ねこ 2019-08-17
  • 打赏
  • 举报
回复
引用 5 楼 陇°的回复:
[quote=引用 3 楼 爱吃鱼的ねこ 的回复:] [quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊[/quote] 额。。。。你会不会Java
陇° 2019-08-17
  • 打赏
  • 举报
回复
引用 3 楼 爱吃鱼的ねこ 的回复:
[quote=引用 2 楼 陇°的回复:][quote=引用 1 楼 爱吃鱼的ねこ 的回复:] 要不out.print试试?
有啊[/quote] 这个大小写乱的很啊,string应该是String,其他的大小写自己看吧.把2个页面的前面说明改成<% page="java" contentType="text/html"; charset="UTF - 8" pageEncoding="UTF - 8"%>,找到web.xml,把默认首页改为你的inpu.jsp[/quote] string小写不可以吗?int都是小写啊
陇° 2019-08-16
  • 打赏
  • 举报
回复
引用 1 楼 爱吃鱼的ねこ 的回复:
要不out.print试试?
有啊
爱吃鱼的ねこ 2019-08-16
  • 打赏
  • 举报
回复
要不out.print试试?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧