简体   繁体   中英

How to map Spring Interceptor

I'm trying to map a Spring Interceptor so it catches every '*.do' request, but I can only make it work in a 'single level'.

My Interceptor mapping path is "/*.do", and I can only intercept URIs like /app/action.do

If I request /app/ anotherLevel /action.do the Interceptor is not triggered.

I've noticed that mapping path = "/*/*.do" catches 'second level' requests, but that does not look correct.

What should be the value of interceptor mapping path so I can intercept all *.do request regardless of the level?

Thanks a lot and sorry for any english mistakes.

I finally figured out how to map every level.

There was a slash missing, so the correct value should be /**/*.do .

I found the trick in the link below:
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-localeresolver-interceptor

Thanks a lot!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM