2013-08-22 38 views
1
页面

我在升级项目中去春来3.2和春季安全3.1的过程中间。站点网格在2.4.2版本中。行为是下一个。 如果我写的下一个URL http://localhost:8081/erp-web/服务器对我来说唯一的登录页面。 page not decorated by sitemesh春季安全3.1的sitemesh不装饰

,但如果我写的下一个URL http://localhost:8081/erp-web/login.mavi服务器给我的登录页面装饰正常。这样page properly decorated.

这是我安全的conf

<security:intercept-url pattern="/decorators/**" access="permitAll"/> 
<security:intercept-url pattern="/resources/**" access="permitAll" />  
<security:intercept-url pattern="/login.do" access="permitAll" /> 

<security:form-login login-page="/login.do" 
    default-target-url="/home.do" authentication-failure-url="/login.do?login_error=1" /> 
<security:logout logout-success-url="/logout.do" delete-cookies="JSESSIONID"/> 

,并在web.xml

<!-- SECURITY --> 
<filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
</filter> 
<filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

<!-- SITEMESH --> 
<filter> 
    <filter-name>sitemesh</filter-name> 
    <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> 
</filter> 
<filter-mapping> 
    <filter-name>sitemesh</filter-name> 
    <url-pattern>/*</url-pattern> 
    <dispatcher>REQUEST</dispatcher> 
    <dispatcher>ERROR</dispatcher> 
    <dispatcher>FORWARD</dispatcher> 
    <dispatcher>INCLUDE</dispatcher> 
</filter-mapping> 

这是视图解析器。

 <bean 
      class="org.springframework.web.servlet.view.InternalResourceViewResolver" 
      p:viewClass="org.springframework.web.servlet.view.JstlView" 
      p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /> 

欢呼声。

回答

3

确定。解决方案很简单。我刚添加到我的decorators.xml这一行

<pattern>/</pattern> 

现在看起来像这样。

<decorator name="login" page="login.jsp"> 
    <pattern>/</pattern> 
    <pattern>/login.do</pattern> 
    <pattern>/spring_security_login</pattern> 
</decorator>