Results 1 to 4 of 4

Thread: I guess we have to use listener to load spring's context

  1. #1
    Join Date
    Jun 2005
    Posts
    8

    Default I guess we have to use listener to load spring's context

    Code:
        <filter>
            <filter-name>Acegi Filter Chain Proxy</filter-name>
            <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
            <init-param>
                <param-name>targetClass</param-name>
                <param-value>net.sf.acegisecurity.util.FilterChainProxy</param-value>
            </init-param>
        </filter>
    The filter will find ApplicatinContext before initialization of spring's servlet. So it'll cause an exception.

    I guess we have to use listener to load spring's context when use Acegi .

    Would it be correct ?

  2. #2
    Join Date
    May 2005
    Location
    Denver, CO, USA
    Posts
    57

    Default

    I believe using ContextLoaderListener works for most people, though it did not for me. I'm stuck with JRun 4, and it apparently initializes the filters ahead of the listeners. Even with my Acegi filters configured for lazy init, I could not get the root application contenxt loaded in time.

    I ended up creating my own ContextLoaderFilter and configured it as the first filter in the chain. This class is a direct ripoff of the Spring ContextLoaderListener code and it does the same thing in the Filter init() method.

    If ContextLoaderListener does not work for you, I can post my ContextLoaderFilter if you need it.

    Best of luck,

    Jeff

  3. #3
    Join Date
    Jun 2005
    Posts
    8

    Default

    Hi,Jeff

    My AppServer is JBoss4,using ContextLoaderListener works for me now. But I'm not sure that it'll works suppose I use tomcat/weblogic/websphere/Resin etc. I had not test still.

    Your idea about ContextLoaderListener is very well. It can ensure the applicationcontext loaded in time. I'll use it if I get into trouble when deploy in other appserver.

    Thanks your reply. ^_^

  4. #4
    Join Date
    May 2005
    Location
    Denver, CO, USA
    Posts
    57

    Default

    You're welcome! Good luck!

    Jeff

Similar Threads

  1. Replies: 2
    Last Post: Jan 20th, 2009, 04:33 AM
  2. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  3. Replies: 2
    Last Post: Jul 27th, 2005, 10:21 AM
  4. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  5. Replies: 0
    Last Post: May 12th, 2005, 07:39 AM

Posting Permissions

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