1.dispatcher(默认)
dispatcher类型表示将请求转发给其他资源,浏览器显示的导向是action。Action中的数据一直保存在。
只能是页面,不能是另一个action(可用type="chain"解决)
<package name="register" namespace="/" extends="yunfile-deafult" > <action name="register" class="com.yingjun.action.RegisterAction" > <result name="success" >/success.jsp</result> <result name="input">/registerform.jsp</result> </action> </package>
2.redirect
redirect是重定向到其他资源(参数会丢失,地址栏会变化。可以防止用户刷新浏览器重复提交表单的信息),浏览器显示的导向是jsp。
<result type="redirect">/testSuccess.jsp</result>
3.chain
用于把相关的几个action连接起来,共同完成一个功能。
<result type="redirect">register</result>
4.redirectAction(和redirect类型在使用上其实并没有什么区别,只是写法不同而已)
<package name="public" extends="struts-default"> <action name="login" class="..."> <!-- Redirect to another namespace --> <result type="redirectAction"> <param name="actionName">dashboard</param> <param name="namespace">/secure</param> </result> </action> </package>
相关推荐
struts2 常用Result类型(type)的用法 Invalid result location value/parameter错误的解决办法
java Web开发,我们最常用的Struts2常用标签总结,帮助你Struts2常用标签有那些功能
struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全...
struts2常用的十个包struts2常用的十个包struts2常用的十个包struts2常用的十个包struts2常用的十个包struts2常用的十个包struts2常用的十个包struts2常用的十个包struts2常用的十个包
struts2中result类型之redirect,重定向
从jsp页面提交form表单后,在struts.xml中寻找匹配的action。在action中处理完业务后返回,在struts.xml中的result属性中转向到另外一个action。
struts2常用标签方法总结
struts2常用的7个jar包,struts2常用的7个jar包,struts2常用的7个jar包,struts2常用的7个jar包,struts2常用的7个jar包
struts2常用标签总结,适合 初学者
关于struts2 Result的配置,有例子
struts2 跳转类型 result type chain dispatcher redirect redirect action
Struts2中的Result的使用类型有很多种,以及各种结果集类型的应用都有涉及(我们老师上课讲的讲义,希望对初学WEB的同学有所帮助)
struts2中result类型之redirectAction
Struts2输入校验总结 Struts2输入校验
Struts2学习资源Result part1.rar
Struts 2在web应用中常用的Struts 2的5个主要类库和包含datetimepicker的struts2-dojo-plugin-2.1.6.jar
Struts2常用的jar包,13个必备jar包,节约开发时间,方便使用!
一些struts2的笔记、项目总结,挺实用