一、跳转到jsp页面
1、服务器跳转
dispatcher是struts默认跳转类型,地址栏显示action,能传值
<action name="login" class="com.dio.blog.util.ActionUtil" method="login">
<result name="error" type="dispatcher">index</result>
</action>
2、客户端跳转
redirect地址栏显示jsp
<action name="login" class="com.dio.blog.util.ActionUtil" method="login">
<result name="error" type="redirect">index</result>
</action>
二、跳转到action
1、服务器跳转
chain是struts默认跳转类型,地址栏显示action,能传值
<action name="login" class="com.dio.blog.util.ActionUtil" method="login">
<result name="error" type="chain">index</result>
</action>
2、客户端跳转
redirectAction地址栏显示jsp,不能向跳转的action传值,必须用param进行传值
<action name="login" class="com.dio.blog.util.ActionUtil" method="login">
<result name="error" type="redirectAction">index</result>
</action>
例如:
三、struts2 action跳转到action 并传值
方法1:<result name="success" type="redirect">跳转Action?参数名字1=参数值1&参数名字2=参数值2</result>
方法2:<result name="success" type="redirect-action">
<param name="actionName">跳转action名字</param>
<param name="参数名字a">${参数名字1}</param>//注意:要在这个action中有一个属性与“参数名字1” 名字相同 并且要提供 get 和set 方法
<param name="参数名字b">${参数名字2}</param>
</result>
action中获取 request.getParamenter("参数名字a");
分享到:
相关推荐
Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作
struts1 中跳 转 方 法 大 全,欢迎下载学习
初学Struts2,写了一个简单的用struts2实现页面跳转的功能。高手勿喷
页面跳转
NULL 博文链接:https://rainbow702.iteye.com/blog/2227847
关于struts2 服务器端跳转的一个小实例
struts_跳转演示
Struts通过拦截器实现登录后跳转到登录前页面
资源中示例了一个struts2的配置文件中配置的action的result结果为另外一个action的配置,该跳转的过程中是带所有参赛调整的,在另外一个action中可以接受到当前action的所有参数,此配置文件是我日常开发中的经验...
action跳转后的页面接收由上一个ACTION传过来的参数
STRUTS2配置相信许多人都会抄, 我只好说一下它的跳转路径了,附图
struts 1.2 跳转后css或js 无效解决方法,不是重定向处理,可以正常使用你的action 或css 或js
首先,Struts的ActionServlet接收到一个请求,然后根据struts-config.xml的配置定位到相应的mapping (映射);接下来如果form的范围是request或者在定义的范围中找不到这个form,创建一个新的form实例;取得form...
NULL 博文链接:https://lishouxinghome.iteye.com/blog/1364946
我的笔记:Struts构架中action的跳转大全
Struts2操作同一action的不同方法跳转jar包(包括示例代码) 使用“项目名/类名!方法名.action”
解决了跳转no fond 的问题
Struts2_04ActionResultType : Struts2关于Action跳转类型的应用 对各种不同的跳转类型使用的实例 Struts2_05Interceptor : Struts2拦截器的使用 Struts2_06FileUpload : Struts2上传文件的使用
struts2 例子 struts.xml基本配置 页面跳转
Struts2 最新漏洞 S2-016、S2-017 修补方案 Struts2 是一个基于 Java 的 Web 应用程序框架,由 Apache 软件基金会维护。最近,Struts2 发生了两个严重的漏洞,分别是 S2-016 和 S2-017,这两个漏洞可能会导致攻击者...