302在Weblogic上移动了Temporary但在Tomcat for Spring Security上运行良好

时间:2015-06-29 14:05:26

标签: spring-mvc tomcat spring-security weblogic-10.x

我能够将应用程序从Tomcat部署到Weblogic 10.3.6,但是当我尝试登录时,它会回到相同的登录页面而日志中没有错误。但是,当我检查请求状态代码时,它说" 302 Moved Temporary"。 它在Tomcat中运行良好。

Spring Security XML

<beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.2.xsd">

    <http pattern="/login" security="none"/>
    <http pattern="/jquery/**" security="none"/>
    <http pattern="/bootstrap/**" security="none"/>
    <http pattern="/icons/**" security="none"/>
    <http pattern="/images/**" security="none"/>
    <http pattern="/css/**" security="none"/>


    <http auto-config="true">
        <intercept-url pattern="/**" access="ROLE_A" />

        <form-login 
            login-page="/login" 
            login-processing-url="/j_spring_security_check.action"
            default-target-url="/abc" 
            authentication-failure-url="/login?error"
            always-use-default-target="true" 
            username-parameter="j_username"
            password-parameter="j_password" />

    </http>

    <beans:bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
        <beans:property name="userDetailsService" ref="userAuthenticationService"/>
    </beans:bean>

    <beans:bean id="authenticationManager"  class="org.springframework.security.authentication.ProviderManager">
      <beans:property name="providers">
        <beans:list>
          <beans:ref bean="daoAuthenticationProvider" />
        </beans:list>
      </beans:property>
    </beans:bean>

    <authentication-manager erase-credentials="false">
        <authentication-provider user-service-ref="userAuthenticationService">
            <password-encoder hash="plaintext"/>
        </authentication-provider>
    </authentication-manager>


</beans:beans>

Web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <display-name>ABC Markup</display-name>


     <servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
        <servlet-class>
                  org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
     </servlet>      

      <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>


    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

     <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/mvc-dispatcher-servlet.xml
            /WEB-INF/spring-security.xml
        </param-value>
    </context-param>
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>classpath:log4j.xml</param-value>
    </context-param>

     <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <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>
    <session-config>
        <session-timeout>20</session-timeout>
    </session-config>
</web-app>

请帮我解决此问题

0 个答案:

没有答案