result type属性:
类型 | 作用 |
dispatcher | 请请求转发(foward)到本应用程序中指定的资源(JSP或Servlet) |
chain | Action链式处理,将请求转发(forward)到指定的Action |
redirect | 请求重定向到指琯的Action |
joson | 实现Ajax时返回JSON对象 |
freemaker | 处理FreeMarker模版 |
httpheader | 控制特殊HTTP行为的结果类型 |
stream | 像浏览器发送InputStream对象,通常用来处理文件下载,还可用于返回Ajax数据 |
velocity | 处理Velocity模版 |
xslt | 处理XML/XLST模版 |
plainTest | 显示原始文件内容 |
示例一:action 跳action 重定向
<action name="update" class="action.UserAction" method="update">
<result name="update" type="redirect">delete</result>
</action>
<action name="delete" class="action.UserAction" method="delete">
<result name="delete">/index.jsp</result>
</action>
示例二:action 跳 action 转发
<action name="login" class="action.UserAction" method="login">
<result name="success" type=chain">
<param name="actionName">update</param>
<param name="namespace">/</param>
</result>
</action>
<action name="update" class="action.UserAction" method="update">
<result name="update" type="redirect">delete</result>
</action>
注:如果是chain:则result里配两个参数,一个请求名,一个路径,redirect则直接跳到就可以
分享到:
相关推荐
struts2 跳转类型 result type chain dispatcher redirect redirect action
struts2中result类型之redirect,重定向
struts2 常用Result类型(type)的用法 Invalid result location value/parameter错误的解决办法
struts2的action的几种result type说明
NULL 博文链接:https://xiongjiajia.iteye.com/blog/1431330
Struts2 result和type
SSH笔记 result标签里面 type的使用 demo包括dispatcher、chain、redirect、redirectAction、stream
前端开源库-result-type结果类型,仅结果类型
jsp\No result defined for action and result input.doc
<result name="add" type="redirect">noticelist.action</result> <result name="failure">/admin/login.jsp</result> <result name="deletenotice" type="redirect">noticelist.action</result> <result name...
deal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal_result.pydeal...
里面包括开发result需要的接口jar包,和接口开发是对数据的判断。
从jsp页面提交form表单后,在struts.xml中寻找匹配的action。在action中处理完业务后返回,在struts.xml中的result属性中转向到另外一个action。
jquery result.xml
请求的url:/item/save 参数:表单的数据。可以使用pojo接收表单的数据,要求pojo的属性和input的name属性要一致。 使用TbItem对象接收表单的数据。 TbItem item,String desc
自定义Result,自定义Annotation的实例
Business Result English for Student book Business Result Second Edition offers business professionals more communication and language practice than ever before, helping students develop relevant ...
在JSP/Servlert/JavaBean技术课程中,本人讲解第六章讲高级JDBC时,再讲到书写通用BaseDAO时,标准课件使用了jstl包中的Result接口来封装数据库的结果集。这样做的结果本人觉得比较麻烦,因为需要导jstl包。如果不想...
result.zip
关于struts2 Result的配置,有例子