Search code examples
springhttp-status-code-404spring-3jetspeed2

@RequestMapping servlet not being found


I have a controller annotation defined like so :

@RequestMapping(value = "/myServlet" , method = RequestMethod.GET)
      public @ResponseBody String performAction() {
        return "success";
      }

This servlet is being invoked via an ajax request. But for some reason this request is not mapped. Its not being found when I attempt to navigate directly to the servlet via the URL. No errors are thrown. I'm just looking for some pointers on how to find out what my problem could be ?


Solution

  • Did you add your controller to the dispatcher-servlet.xml (or whatever name you use for it) ?

    At the very least, for each controller you should have something like

    <bean name="contollerName"  class="package.ControllerName"/>