Announcement Announcement Module
Collapse
No announcement yet.
HTTP 404 The requested resource (/testapp//j_spring_security_check) is not available. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTTP 404 The requested resource (/testapp//j_spring_security_check) is not available.

    Hello,

    I am new to Spring and I am trying to use Spring Security for a simple
    (no Spring Framework for the app per se) webapp as a trial run. I think
    I am missing something basic in the below:

    $ cat security-app-context.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/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.1.xsd">

    <global-method-security pre-post-annotations="enabled" />

    <http auto-config="true" use-expressions="true">
    <intercept-url pattern="/index.jsp" access="permitAll" />
    <intercept-url pattern="/secure.jsp" access="isAuthenticated()" />
    <form-login login-page="/login.jsp"/>
    </http>

    <authentication-manager>
    <authentication-provider>
    <user-service>
    <user name="rod" password="koala" authorities="supervisor, teller, user" />
    <user name="dianne" password="emu" authorities="teller, user" />
    <user name="scott" password="wombat" authorities="user" />
    <user name="peter" password="opal" authorities="user" />
    </user-service>
    </authentication-provider>
    </authentication-manager>
    </beans:beans>


    $ cat web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
    <display-name>Spring Security Test Client</display-name>

    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <!--
    - Loads the root application context of this web app at startup.
    -->
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/security-app-context.xml
    </param-value>
    </context-param>
    <context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>tutorial.root</param-value>
    </context-param>

    <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
    </filter>

    <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>


    </web-app>


    $ cat login.jsp
    <div id="login_dialog" class="login_dialog">
    <form name="f" action="/testapp/j_spring_security_check" method="POST">
    <div id="user_name_login">
    <h2>Username</h2>
    <input autocapitalize="off" autocorrect="off" id="username" name="j_username" type="text"><br>

    <h2>Password</h2>
    <input id="password" name="j_password" type="password"><br>

    <label><input class="auto" id="remember_me" name="remember_me" value="1" type="checkbox"> Remember me on this computer</label><br>

    <input class="button" name="commit" value="Sign in" type="submit">


    Initially I didn't even define login-page (simply had <form-login />) but then I ran into a different issue
    of /testapp/spring_security_login not being found. Now with login.jsp, I see the login form but then when I
    submit the form I run into the 404 in regard to j_spring_security_check not being found.

    I would greatly appreciate any help/pointers.

    Thanks.

  • #2
    Attached is the log. Any help is greatly appreciated.

    Comment


    • #3
      I have the above issue in a CentOS 5.8 running Tomcat 5.5. I just now tried it on a Fedora 15 machine running Tomcat 6 and it works. However I have apps that need to run on the former platform. I would appreciate any info/ideas on what might be going wrong.

      Comment

      Working...
      X