打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Struts2全局跳转与局部跳转
userphoto

2011.11.08

关注
struts2.0的全局跳转  
         <global-results>  
              <result name=”ok”>/ok.jsp</result>  
         </global-results>  
struts2.0的局部跳转:  
            <action name=”login” class=”dd.login”>  
                <result name=”ok”>/ok.jsp</result>  
            </action>  
全局异常:  
   <global-exception-mappings>  
   <exception-mapping result=”error” exception=”java.lang.Exception”/>  
  </global-exception-mappings>  
   要在<global-results>  
          <result name="error">/error.jsp</result>  
       </global-results>  
 
在action中指明该action处理的方法:  
  <action name=”login” class=”xxx.loginAction” method=”login”>  
  <result name=”ok”>/ok.jsp</result>  
  </action>  
-------------------------------------------------
从action1直接跳转到action2,有两种方法:

1. 需要保存前一个action的属性信息时使用:
          <result type= "chain ">action2</result>
2. 不保存前一个action的参数可以用这种方法:
          <result    type= "redirect-action "> ActionName </result>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
修改struts2 显示的URL 后缀 为.action 为 .jsp
struts2 示例
struts2中的action跳转后的jsp中css失去作用的问题
Struts2中使用token避免重复提交的方法
Struts2中关于“There is no Action mapped for namespace / and action name”的总结
标签package中的namspace的用法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服