I am using web.xml to divert any .htm to dispatcher.
web.xml:
<servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> In my dispatcher I say:
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="index.htm">indexController</prop> <prop key="books.htm">bookServlet</prop> </props> </property> </bean> Now all works but I need a method inside BookServlet to work when the url is .../books.htm/doSomething I use RequestMapping inside the servlet like so:
@RequestMapping(value = "book.htm/doSomething", method = RequestMethod.GET) But when I add /doSomething I lose the servlet because is it not mapped to the servlet in the dispatcher anymore. I am confused as to how do I use /* approach in dispather because it sure is not working line in the web.xml.
No comments:
Post a Comment