Handling web request using SpringMVC

A request carries user information from the web to the background, and the life cycle of a request from start to end:

Request => Servlet => (Find the appropriate Controller based on Handler Mapping) = > Controller => Remove the user information processing request and return the modelAndView object to the Servlet => View

1. Configure Servlet

In the web.xml of the system Configure servlet information in the

  roadrantz // Give the servlet a name*

  < servlet-class>org.springframework.web.servlet.DispartchServlet //

  1

*When giving one The servlet defines a name. When the DispartchServler is loaded, it will read the application context from the XML file. The name of the XML file depends on the name of the servlet. In this example, the name of the servlet is roadrantz

So, DispartchServler will try Load the application context from the roadrantz-servlet.xml file.

Next

Leave a Comment

Your email address will not be published.