struts2 action result type类型】的更多相关文章

struts2 action result type类型 1.chain:用来处理Action链,被跳转的action中仍能获取上个页面的值,如request信息. com.opensymphony.xwork2.ActionChainResult 2.dispatcher:用来转向页面,通常处理JSP org.apache.struts2.dispatcher.ServletDispatcherResult 3.freemaker:处理FreeMarker模板 org.apache.strut…
Struts2 中result type属性说明 首先看一下在struts-default.xml中对于result-type的定义: <result-types><result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/><result-type name="dispatcher" class="org.apac…
result标签中type的类型 类型 说明 chain 用于Action链式处理 dispatcher 用于整合JSP,是<result>元素默认的类型 freemarket 用来整合FreeMarket httpheader 用来处理特殊的HTTP行为 redirect 用来重定向到其它文件 redirectAction 用来重定向到其它Action stream 用来香浏览器返回一个InputStream velocity 用来整合Velocity xslt 用来整合XML/XSLT p…
result type: dispatcher,redirect:只能跳转到jsp,html之类的页面,dispatcher属于服务器跳转, redirect属于客户端跳转 chain: 等同于forwardaction, redirectAction: 客户端跳转到另一个action 还有freemarker,httpheader,stream(下载),volocity(类似freemarker), xslt, plaintext,tiles <?xml version="1.0&quo…
Stream result type是Struts2中比较有用的一个feature.特别是在动态生成图片和文档下载的情况下 1:图片验证码: Action类,action主要要提供一个获取InputStrem的方法: public class CheckCodeAction extends ActionSupport implements SessionAware { private Logger log = LoggerFactory.getLogger(this.getClass()); p…
result > 每个 action方法都将返回一个 String 类型的值,Struts 将根据这个值来决定响应什么结果. > 每个 Action声明都必须包含有数量足够多的 result 元素, 每个 result元素分别对应着 action 方法的一个返回值. > result 元素可以有下面两个属性     • name: 结果的名字, 必须与 Action方法的返回值相匹配, 默认值为 success     • type: 响应结果的类型. 默认值为 dispatcher =…
转自:http://wangquanhpu.iteye.com/blog/1461750 1, ignoreHierarchy 参数:表示是否忽略等级,也就是继承关系,比如:TestAction 继承于 BaseAction,那么 TestAction 中返回的 json 字符串默认是不会包含父类 BaseAction 的属性值,ignoreHierarchy 值默认为 true,设置为 false 后会将父类和子类的属性一起返回. <result type=”json”> <param…
一.在strut2的action处理完成后,就应该向用户返回结果信息result 根据以下代码作为实例分析: <package name="Hello" extends="struts-default"> <global-results> <result name="error">error.jsp</result> </global-results> <action name=&…
1.action类引入struts2的"json-default"拦截器栈 @ParentPackage("json-default") //示例 @ParentPackage(WapBaseAction.WAP_PACKAGE) //WAP_PACKAGE继承了json-default @Namespace("/") public class ModifyResumeAction extends WapBaseAction {... 2.@Ac…
<!--struts.xml配置--> <action name="download" class="com.unmi.action.DownloadAction"> <result name="success" type="stream"><!--type 为 stream 应用 StreamResult 处理--> <param name="contentTy…