六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 37|回复: 0

struts1中mapping.findForward(null);

[复制链接]

升级  92.67%

57

主题

57

主题

57

主题

秀才

Rank: 2

积分
189
 楼主| 发表于 2013-1-23 02:23:58 | 显示全部楼层 |阅读模式
参考资料说明:
If the findForward( ) method does not find a forward that matches the name argument, it will not complain. A null will be returned, and you will receive a blank page because no output will be written to the response.

就是说找不到的话,会返回一个null

分析一:
   如果直接return mapping.findForward(null);
则会必然在配置文件中找不到映射,则会在浏览器显示空白页面。
   但如果使用的是jquery中的Ajax,采用的异步请求,这会保持在原来的页面。
   返回的信息在out.write("output content");
分析二:
  如果return mapping.findForward("name");
  而配置文件中也没有“name”此对应路径也会直接在浏览器显示空白页面。
  但如果使用的是jquery中的Ajax,采用的异步请求,这会保持在原来的页面。
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表