maomaozgc 发表于 2013-1-23 02:23:58

struts1中mapping.findForward(null);

参考资料说明:
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,采用的异步请求,这会保持在原来的页面。
页: [1]
查看完整版本: struts1中mapping.findForward(null);