Struts 2 结果和结果类型
来源:互联网 发布:java高级程序设计图片 编辑:程序博客网 时间:2024/05/16 15:41
<results>标记扮演着Struts2 MVC中视图的角色,默认情况下,struts2使用jsp作为视图技术,但也不强制使用,还有其他的视图技术,比如xml,json等。Struts2有多种结果类型
<result-types>
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
<result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
<result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
<result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
<result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
<result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
<result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
<result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
<result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
<result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
</result-types>
默认使用dispatcher,转发请求道jsp页
简洁版:
<result name="success"> /HelloWorld.jsp</result>
使用<param>标记版
<result name="success" type="dispatcher"> <param name="location"> /HelloWorld.jsp </param ></result>
redirect 结果类型调用标准的response.sendRedirect() 方法,浏览器从指定位置获得请求,下面是一个例子
<action name="hello" class="com.tutorialspoint.struts2.HelloWorldAction" method="execute"> <result name="success" type="redirect"> <param name="location"> /NewWorld.jsp </param > </result></action>
- Struts 2 结果和结果类型
- Struts(9)结果和结果类型
- Struts(9)结果和结果类型
- struts结果类型
- struts结果类型
- struts处理结果类型——局部结果和全局结果
- Struts2 结果和结果类型
- Struts2-结果和结果类型
- Struts常用结果返回类型
- Struts自定制结果类型
- struts.xml中的结果类型与视图
- struts配置文件中结果类型小结
- struts中的结果集类型Result
- struts 2动态结果集
- Struts自定义结果类型实现Ajax验证(ssh)
- 【Struts框架】第二节Result-结果类型_result_type
- 关于Struts中结果类型chain的理解
- struts 2配置两种的结果
- CentOS 6.4 + 曙光DS200 IPSan组建FTP服务器
- git clone warning: remote HEAD refers to nonexistent ref, unable to checkout
- Cocos2d-x VS2010 win32 输出中文字符的方法
- CString.Format的详细用法(转)
- iOS UDID使用方法
- Struts 2 结果和结果类型
- python pymssql freetds,用python访问sqlserver
- Jquery Uploadify多文件上传带进度条且传递自己的参数
- oracle 11g数据库”enq: TX - row lock contention“等待事件的处理
- 近几年的开发经验:数据库设计中三大范式应用场景解析
- php批量上传图片提示Warning: Invalid argument supplied for foreach()
- ORA-12005: may not schedule automatic refresh for times in the past
- POJ2485——Highways
- PLSQL 误删表恢复