ralasafe与struts的一些分享

最近在学习ralasafe,写一点与struts整合时filter配置的分享,这是我的第一篇blog,请各位高手指教一下

UrlAclFilter需要配置在struts的filter前面,不然执行了struts的filter后UrlAclFilter好像没有执行到;UrlAclFilter有效果的话,你要是没权限访问该页面时会跳到denyPage,没登陆的话会跳转到loginPage;   其次是struts的filter放在LoginFilter的前面,放在后面的话会一直跳到登录页面去.

<filter>
<filter-name>ralasafe/UrlAclFilter</filter-name>
<filter-class>org.ralasafe.webFilter.UrlAclFilter</filter-class>
<init-param>
<param-name>loginPage</param-name>
<param-value>/ralasafe/demo/login.jsp</param-value>
</init-param>
<init-param>
<param-name>denyPage</param-name>
<param-value>/ralasafe/demo/noPrivilege.jsp</param-value>
</init-param>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter>
<filter-name>ralasafe/LoginFilter</filter-name>
<filter-class>org.ralasafe.webFilter.LoginFilter</filter-class>
<init-param>
<param-name>loginPage</param-name>
<param-value>/ralasafe/demo/login.jsp</param-value>
</init-param>
</filter>




你可能感兴趣的:(struts)