Results 1 to 4 of 4

Thread: simple applicationContext.xml sample

  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Default 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. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    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>
    ?
    Spring - by Pivotal
    twitter @tekul

  3. #3
    Join Date
    Jun 2010
    Posts
    2

    Default

    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.

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    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.
    Spring - by Pivotal
    twitter @tekul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •