Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring controller mapping

 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I've got this servlets.xml:




And these lines of code in web.xml:



Clicking on the link that should take me to that page (services/repository/marketSegmentModification.jsp) i get a 404 error. I should mention that the link is clicked from an applet which contains the following code:




If i put a jsp in the exact location, everything is ok.

So...what am i doing wrong?

Thanks
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK - I'm assuming that MarketSegmentModificationController extends MultiActionController because it's using methodNameResolver - so you're using Spring MVC as the view layer, right? But I don't see a DispatcherServlet set up in web.xml - even if you have application contexts loaded through ContextLoaderListener, you still need to set up a DispatcherServlet to act as a front controller for Spring MVC.
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, true, forgot about that.

But i still get an error... it says that no mapping for that controller is found in DispatcherServlet.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the error you received? It may be that you didn't create a "<dispatcherServletName>-servlet.xml" file - you still need to create one (or use the contextConfigLocation init-param to point to another).
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind. It was problem with the actual mapping of the controller. Thanks for the input.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic