`
King_XR
  • 浏览: 26619 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Struts.xml的action中result的type类型分析

阅读更多
1、dispatcher:

该类型为result默认类型,在配置result的时候若不指定type,默认就是dispatcher类型的,dispatcher请求转发的意思,直接把客户端的请求在服务器处理以后跳转到下一个页面,用户请求的信息将被保留
<result type="dispatcher">/one.jsp</result> 

意思是说直接跳转到one.jsp页面上。

2、redirect:

redirect结果类型表示将请求重定向到其他资源,用户请求的信息将不被保留.

3、chain:

转向另一个action,URL地址不会变

4、redirecAction:

重定向到一个action,其中URL会改变的!
1
0
分享到:
评论

相关推荐

    struts2 result转向到action

    从jsp页面提交form表单后,在struts.xml中寻找匹配的action。在action中处理完业务后返回,在struts.xml中的result属性中转向到另外一个action。

    第一个struts程序

    这个问题搞了一个晚上。(希望对初学的朋友有帮助) 发现不能运行的原因 1、login.jsp的form表格里的...4、struts.xml中的&lt;result name="Sucess"&gt;/loginsucess.jsp&lt;/result&gt; name要与LoginAction.java的返回结果相对应.

    Struts2的struts.xml配置详细介绍

    解析: constant元素: 配置常量,可以改变Struts 2框架的一些行为 name属性表示常量名称,value属性表示常量值 package元素: 包的作用:简化维护工作,提高重用性 ...result元素: name属性:默认为succ

    struts2示例程序

    struts.xml &lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"&gt; ...

    Struts2 国际化字符串 拦截器

    下面让我们来做一个Velocity模板输出的例子,首先在classes/struts.xml中新建一个Action映射(Mapping),将其result类型设为velocity,如以下代码所示: &lt;action name="VMHelloWorld" class="tutorial.HelloWorld"&gt;...

    struts2课件

    struts2课件 很好的struts2当输入login.jsp访问jsp页面填写完相关信息并提交给login.action时,它会...LoginAction内部会执行execute方法,并返回结果result(result也是参照的struts.xml中action下的result配置)。

    Struts2属性文件详解

    该属性设置Struts 2是否允许在Action名中使用斜线,该属性的默认值是false.如果开发者希望允许在Action名中使用斜线,则可设置该属性为true. struts.tag.altSyntax 该属性指定是否允许在Struts 2标签中使用表达式语法...

    Struts2入门教程(全新完整版)

    (2).struts.xml文件 4 (3).struts.properties(参default.properties) 4 (4)struts-default.xml 4 (5)其它配置文件 4 4.让MyEclipse提示xml信息 4 5.如何使用alt+/提示 4 6.实例 4 7.开启struts2自带的...

    struts2实例 学生信息管理系统

    &lt;result type="redirect"&gt;List.action&lt;/result&gt; &lt;/action&gt; &lt;action name="Remove" class="action.BookAction" method="remove"&gt; &lt;result type="redirect"&gt;List.action&lt;/result&gt; &lt;/action&gt;--&gt; &lt;/struts&gt;

    Struts2详解,Struts2与Struts1的区别

    struts.xml文件 三. Struts2深入开发 6. 常用&lt;Action&gt;标签配置和使用 7. 常用&lt;result&gt;标签配置和使用 8. 标签 9. Action类的开发 10. 数据类型转换器 11. 实现文件上传 12. Struts2的拦截器 13. ...

    搭建struts2框架

    struts2框架的详细搭建 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" ...

    struts-2.3.4.1所需的jar文件

    struts.xml &lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"&gt; ...

    Struts2\constant应用

    &lt;!-- 指定Web应用的默认编码集,相当于调用HttpServletRequest的setCharacterEncoding方法 --&gt; &lt;constant name="struts.i18n.encoding" value="UTF-8" /&gt; ...该属性指定Struts 2中的action由哪个容器创建

    struts2配置2.5版

    &lt;result&gt; /result.jsp &lt;/result&gt; &lt;/action&gt; &lt;package name="LoginForm" extends="struts-default"&gt; &lt;action name="login" class="com.mytest.LoginAction" method="execute"&gt; &lt;result&gt; /login.jsp &lt;/...

    struts2零配置个人整理文档

    默认所有的结果页面都存储在WEB-INF/content下,你可以通过设置struts.convention.result.path这个属性的值来改变到其他路径。如: Xml代码 &lt;constant name="struts.convention.result.path" value="/WEB-INF/page" ...

    struts2.0扫盲文档

    struts2.0扫盲文档2加入struts.xml配置文件(自己建) &lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" ...

    struts2+spring2+ibates

    4、sqlmapconfig.xml中传入参数和result的设置,只需要将得到的值result映射到有此属性的类对象. 5、JSP/Servlet中获得当前应用的相对路径和绝对路径 JSP中获得当前应用的相对路径和绝对路径 根目录所对应的绝对...

    struts2文件上传

    在struts2中实现文件上传。 &lt;struts&gt; &lt;include file="struts-default.xml"&gt; &lt;constant name="struts.i18n.encoding" value="GBK"&gt; &lt;!--设置临时上传目录--&gt; &lt;constant name="struts.multipart.saveDir" value="d:\...

    Struts2 2.3.16_doc

    It is strongly recommended that if you are redirecting to another action, you use this result rather than the standard redirect result. See examples below for an example of how request parameters ...

    整合struts2和spring源代码(可以直接在tomcat中运行)

    注意:如果让spring来创建对象可以将action中的class属性中的值为spring 中bean 中的id值,如果想让struts来创建可以直接指定类 附加: 整合原理 : Struts2与Spring的集成要用到Spring插件包struts2-spring-plugin...

Global site tag (gtag.js) - Google Analytics