一起去看海

2010/05/21

struts2中使用jsp:forward命令

Filed under: Web开发 — Tags: — admin @ 20:47

工程中用到了struts2,index.jsp中使用jsp:forward命令跳转来执行action,web.xml中需要做如下配置:

[xml]<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>[/xml]

不明白为什么要这样配置,有时间好好研究一下。如果觉得配置web.xml很麻烦,不如使用jstl的redirect标签来跳转,可以达到一样的效果。

[xml]<c:redirect url="/login.action"></c:redirect>[/xml]

5 Comments »

  1. 朋友推荐过来的…文章有深度.

    Comment by 民族证券 — 2010/05/22 @ 02:22

  2. 有时间常来看看啊,博客不旬!

    Comment by 职称论文发表 — 2010/05/24 @ 13:42

  3. 纯代码文章

    Comment by 卢松松 — 2010/05/26 @ 13:38

  4. 额,文章就是代码,代码就是文章

    Comment by 淘宝网批发 — 2010/07/13 @ 15:53

  5. 我的博客也不错 嘿嘿 就是没人看。没什么说的,我都感觉自己写的内容都在老调重弹。还是你的www.ooobj.com犀利点…

    Comment by indian curry recipes — 2010/10/06 @ 11:22

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress