Take the 2-minute tour ×

I've written the code for a servlet to serve images in my app from a url such as:


So this would be one additional servlet in the app besides the Dispatcher servlet.

The problem is, I don't know how do you configure Spring to call this new servlet from the Dispatcher servlet?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Can you make it clear that why you should call the new servlet from the Dispatcher servlet, what not just add a new servlet?

share|improve this answer
I thought every resource has to be called from the dispatcher in Spring. Won't the url '/imgsrv' be seen by Dispatcher first? –  cafe Aug 30 '10 at 15:07
I'm not sure that i got what you mean. A dispatcher servlet is a servlet, so you can configure a servlet-mapping for the dispatcher in web.xml to let it handle the specific url and bypass the urls you don't want it to handle. –  khotyn Aug 30 '10 at 15:20
add comment

Your Answer


