What is the DispatcherServlet function in Spring?

1

What is the purpose of it? is it recommended to use spring-boot to do all spring xml settings automatically?

    
asked by anonymous 22.09.2015 / 13:51

1 answer

1

TheworkofDispatcherServletistogetarequestedURIandfindtherightcombinationofthehandler(usuallymethodsinthecontrollerclasses)andviews(usuallyJSPs)thatmatchforthepageformorresourcesupposedtobefoundinthatlocation./p>

Icanhave:

  • a/WEB-INF/jsp/pages/Home.jspfile.
  • Amethodintheclass

    @RequestMapping(value="/pages/Home.html")
    private ModelMap buildHome() {
        return somestuff;
    }
    
The Dispatcher Servlet is the piece that "knows" to call the method when the browser requests the page, combines the results with the JSP file, and generates an HTML document.

References and complete answer in English:

link

Documentation:

link

    
22.09.2015 / 15:07