Announcement Announcement Module
Collapse
No announcement yet.
Interceptor to redirect to another url? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interceptor to redirect to another url?

    In our group we have a web application that uses spring+acegi.
    The acegi part of it was developed by someone that has left the company. From what I can see we use the following:

    DaoAuthenticationProviderManager
    FilterSecurityInterceptor and SecurityEnforcementFilter
    AuthenticationBasedAccessDecisionManager

    We have a need to develop another application that will use this same webapplication for the most part but should be able to override/redirect certain jsps. I am trying to figure out if there is a way to intercept the request and redirect based on a request parameter. Is this easy to do?

    Thanks,
    Aruna

  • #2
    If you're sure you need to do that, you can define one of these...

    Code:
    <bean id="myProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
      <property name="beanNames"><value>*.htm</value></property>
      <property name="interceptorNames">
          <list>
            <value>myMethodInterceptor</value>
          </list>
      </property>
    </bean>
    where myMethodInterceptor implements org.aopalliance.intercept.MethodInterceptor, you can get the ModelAndView that would otherwise have been returned by your controller, and then return whatever you like.

    This might mean you slightly modify what is returned by adding stuff to the model (if one exists), or return something completely different.

    Comment


    • #3
      Not sure what AuthenticationBasedAccessDecisionManager does. It's not a standard Acegi Security class. I would try to minimise customisations spreading into other webapps, unless you're sure on its purpose and design.

      Regarding your redirection question, you might like to consider using classes in net.sf.acegisecurity.securechannel. You could write a custom ChannelProcessor which detects ConfigAttributes that mark requests that should be redirected.

      Comment

      Working...
      X