Results 1 to 3 of 3

Thread: Acegi, Spring Context / DispatcherServlet / authz.tld

  1. #1
    Join Date
    Dec 2004
    Location
    U.K.
    Posts
    2

    Default Acegi, Spring Context / DispatcherServlet / authz.tld

    Hi,

    I'm adding Acegi to an existing Spring MVC application. I have the user authenticating working (if I enter Valid/Invalid users/passwords it forwards to the correct pages). But I'm not able to use the tag libraries in my JSP pages i.e. <auth:authorize ifAllGranted="ROLE_SUPERVISOR"> logged in </auth:authorize>.

    I believe this is due to my lack of understanding of how the ApplicationContext works. I use the org.springframework.web.servlet.DispatcherServlet / org.springframework.web.servlet.handler.SimpleUrlH andlerMapping.

    Any help would be appreciated.

    web.xml

    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>BEOExchange</display-name>
    <description>BEO Exchange</description>

    <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/classes/log4j.properties</param-value>
    </context-param>

    <listener>
    <listener-class>org.springframework.web.util.Log4jConfigList ener</listener-class>
    </listener>

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/BEOExchangeContext.xml</param-value>
    </context-param>

    <filter>
    <filter-name>Acegi Authentication Processing Filter</filter-name>
    <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
    <init-param>
    <param-name>targetClass</param-name>
    <param-value>
    net.sf.acegisecurity.ui.webapp.AuthenticationProce ssingFilter
    </param-value>
    </init-param>
    </filter>

    <filter-mapping>
    <filter-name>Acegi Authentication Processing Filter</filter-name>
    <url-pattern>*.htm</url-pattern>
    </filter-mapping>

    <servlet>
    <servlet-name>BEOExchange</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>BEOExchange</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>

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

    <taglib>
    <taglib-uri>/spring</taglib-uri>
    <taglib-location>/WEB-INF/spring.tld</taglib-location>
    </taglib>

    <taglib>
    <taglib-uri>/WEB-INF/displaytag.tld</taglib-uri>
    <taglib-location>/WEB-INF/displaytag-el-12.tld</taglib-location>
    </taglib>

    <taglib>
    <taglib-uri>http://acegisecurity.sf.net/authz</taglib-uri>
    <taglib-location>/WEB-INF/authz.tld</taglib-location>
    </taglib>

    </web-app>

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Your web.xml is missing several of the Acegi Security filters that are needed for the system to operate. Check the Contacts sample application, which shows the additional filter required, noting to preserve the correct ordering as this is important.

  3. #3
    Join Date
    Dec 2004
    Location
    U.K.
    Posts
    2

    Default

    Thanks, this was enough of a pointer to allow me to correct the problem.

Similar Threads

  1. Replies: 2
    Last Post: Sep 8th, 2005, 05:50 AM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Spring http invoker: retrieving the application context...?
    By gvl@foundation.be in forum Remoting
    Replies: 1
    Last Post: Jun 21st, 2005, 12:59 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 2
    Last Post: Jan 21st, 2005, 04:17 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
  •