Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring interceptor in Spring

I am using Spring 3.0

I need to write an interceptor which intercepts all urls. in my application

I wrote one intercptor

public class HelloInterceptor extends HandlerInterceptorAdapter {

how can i configure it in spring-servlet.xml.

like image 871
Abhi Avatar asked Feb 19 '26 11:02

Abhi


1 Answers

Using <mvc:interceptors> (see docs), e.g.

An example of registering an interceptor applied to all URL paths:

<mvc:interceptors>
    <bean class="x.y.HelloInterceptor" />
</mvc:interceptors>
like image 138
skaffman Avatar answered Feb 21 '26 13:02

skaffman