Professional Documents
Culture Documents
Description: Display the view on the browser that is configured. I have made an
attempt to write a basic controller of spring.
All the requests in spring are handled by RequestDispatcher, if the name of the servlet
is demo then we need to have a spring configuration file with the name
demo-servlet.xml in the WEB-INF directory
Step 2: Assume that if all our requests have to pass through spring controller before
the view is rendered. The Controller should be as below
The controller will return ModelAndView Object, where the name of the view is
index.
Step 3: We need to configure this controller in the spring configuration file
i.e. demo-servlet.xml, the spring container loads the controller through IOC
Reference:
http://static.springframework.org/spring/docs/2.0.x/reference/mvc.html