2

Main xml tags:

   <mvc:annotation-driven/>

   <mvc:resources mapping="/pages/**" location="/pages/"/>

   <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <bean class="dan.MyInterceptor">
            </bean>
        </mvc:interceptor>
    </mvc:interceptors>

All the requests from /pages/** won't enter the interceptor,'/pages/test.jsp',for example.

1
  • Can you show us the structure of your webapp ?
    – MounirReg
    Aug 16, 2012 at 8:15

1 Answer 1

0

Try removing the mvc:mapping tag. It's redundant, by default an interceptor is run against all requests unless otherwise restricted.

Also this answer suggests that ordering may be important; try placing the interceptor ahead of the resource mappings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.