12 Replies Latest reply on Jan 28, 2019 10:42 PM by yi chun Chen

    spring mvc dispatcher servlet mapping

    poor thing Newbie

      Hello i have a trouble with spring mvc in jboss 7.1.1.Final. HomeController returns simple hello world jsp page.



      public class WebConfig implements WebApplicationInitializer {


                    public void onStartup(ServletContext servletContext) throws ServletException {

                        AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();


                        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(rootContext));



                        servletContext.addListener(new ContextLoaderListener(rootContext));






      public class HomeController {

          protected static final String INDEX_VIEW = "index";

          @RequestMapping(value = "/", method = RequestMethod.GET)

          public String showPage() {

              return INDEX_VIEW;












      accessing localhost:8080 results in 404. I've set jboss logging to debug, and i don't see "dispatcher proccessing get request" kinda thing. Does this mean servlet is not mapped? Everything works fine on tomcat 7 and jetty 8.