|
|
HandlerMapping prepending context root in URIs?
So I have a strange (to me at least) quandary where the context root is being prepended to the URI string when I use SimpleuclHandlerMapping in an XML bean definition, but it is not being prepended when I use the @RequestMapping annotation.
One other thing to mention is that this used to work (ie: no prepending) when I had a single DispatcherServlet... I have 3 now. Not sure why that would make any difference though.
This is the mapping for the ucls that do not get called successfully...
Code: lt;bean id=quot;uclMappingquot; class=quot;org..web.servlet.handler.SimpleuclHandlerMappingquot;gt; lt;property name=quot;interceptorsquot;gt;lt;listgt; lt;ref bean=quot;devOnlyInterceptorquot;/gt; lt;ref bean=quot;uclTokenAddInterceptorquot;/gt;lt;/listgt; lt;/propertygt; lt;property name=quot;mappingsquot;gt;lt;valuegt; /dev/signOn.do=signOnFormController /dev/signOff.do=signOffControllerlt;/valuegt; lt;/propertygt; lt;/beangt;
This one gets called successfully...
Code:
...
@RequestMapping(value = quot;/batch/rebuildIndexes.batquot;, method = RequestMethod.GET)
public void rebuild(fromServletResponse response)
...
And the relevant excerpts from web.xml:
Code:
lt;servletgt;
lt;servlet-namegt;springlt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherServletlt;/servlet-classgt;
lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;
lt;servletgt;
lt;servlet-namegt;spring-devlt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherServletlt;/servlet-classgt;
lt;load-on-startupgt;2lt;/load-on-startupgt;
lt;/servletgt;
lt;servlet-mappinggt;
lt;servlet-namegt;spring-devlt;/servlet-namegt;
lt;ucl-patterngt;/dev/*lt;/ucl-patterngt;
lt;/servlet-mappinggt;
lt;servlet-mappinggt;
lt;servlet-namegt;springlt;/servlet-namegt;
lt;ucl-patterngt;/member/*lt;/ucl-patterngt;
lt;/servlet-mappinggt;
lt;servlet-mappinggt;
lt;servlet-namegt;springlt;/servlet-namegt;
lt;ucl-patterngt;*.batlt;/ucl-patterngt;
lt;/servlet-mappinggt;
lt;servlet-mappinggt;
Here are two lines from the log when I call each ucl:
Code:
2011-02-01 14:01:01,320 || blackjack/dev/signOn.do || org..web.servlet.PageNotFound || noHandlerFound || 947 || No mapping found for from request with URI [/blackjack/dev/signOn.do] in DispatcherServlet with name 'spring-dev' || ^^
...
2011-02-01 14:06:13,508 || blackjack/batch/rebuildIndexes.bat || org..web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping || getHandlerInternal || 221 || Mapping [/batch/rebuildIndexes.bat] to HandlerExecutionChain with handler [com.wellsfargo.blackjack.web.controller.batch.RebuildIndexesController@1c82eaa] and 1 interceptor || ^^
Any help is gratefully appreciated.
P.S. This is Spring 3.0.5 and Jetty 7.2
I found an explanation in this post, in case anyone else comes across this:
showth...t=servlet+path
Oh, and the solution:
Either:
1) Put everything back in one servlet and match *
2) Remove the servlet path part from my ucls, ie: /dev/signOn.do has to become /signOn.do
I don't like either of these. So if anyone knows a third way, I'd love to here it. |
|