Announcement Announcement Module
Collapse
No announcement yet.
simple applicationContext.xml sample Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • simple applicationContext.xml sample

    Does anyone care to share a full, non-snippet copy of applicationContext.xml that will work with the minimal namespace example outlined in chapter 2 of the reference guide? Thanks in advance.

  • #2
    You mean something like:

    Code:
    <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-3.0.xsd
               http://www.springframework.org/schema/security
               http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    
        <http>
           <intercept-url pattern="/**" access="ROLE_USER" />
           <form-login />
           <logout />
        </http>
    
        <authentication-manager>
            <authentication-provider>
              <user-service>
                <user name="jimi" password="jimispassword" authorities="ROLE_USER, ROLE_ADMIN" />
                <user name="bob" password="bobspassword" authorities="ROLE_USER" />
              </user-service>
            </authentication-provider>
        </authentication-manager>
    
    </beans:beans>
    ?

    Comment


    • #3
      Thank you. It still doesn't work with the 3.0.2 version of this error (http://forum.springsource.org/showthread.php?t=50659) but at least it's not a SAX Exception.

      I notice that the namespace declaration portion is different from the one shown on your blog which was where I had wound up after a day. As an admittedly new user porting an existing security 2.0.x app to 3.0.x I'd like to gently point out that it's been very difficult to find a complete and fresh baseline example. The tutorials don't declare namespaces and the reference documentation doesn't either. It may have been me. One's eyes do tend to fog.

      Thanks again.

      Comment


      • #4
        Almost all the sample applications use the namespace, so they do have the schemas declared. We'd generally recommend that you start with a working sample war file (such as the "tutorial" sample), rather than trying to put together something from scratch as that avoids issues such as classpath problems.

        Comment

        Working...
        X