Two. The description of the XML file.
Framework steps:
1. Add the jar package to the Lib folder
2. Configure Web. XML, that is, configure the front controller Dispatcherservlet
1 <servlet>2 <Servlet-name>Springmvc</Servlet-name>3 <Servlet-class>Org.springframework.web.servlet.DispatcherServlet</Servlet-class>4 </servlet>5 <servlet-mapping>6 <Servlet-name>Springmvc</Servlet-name>7 <Url-pattern>*.do</Url-pattern>8 </servlet-mapping>
3, create the SPRINGMVC configuration file under Web-inf, the name is: [Servlet-name]-servlet.xml
4, in the Springmvc-servlet.xml configuration handlermapping, according to Beanname find the corresponding controller
5. Configure the View resolver in springmvc-servlet.xml: prefix and suffix.
1 <Beanclass= "Org ... Omit ... view. Internalresourceview "> 2 <! -- Prefix-->3 < Propertyname= "prefix"value= "/view/"></ Property>4 <!--suffix -5 < Propertyname= "suffix"value= ". jsp"> </ Property></Bean>
6. Configure the controller in the Springmvc-servlet.xml.
Enclosed Hello source Code ~ ~
Http://files.cnblogs.com/files/chenzhefan/hello.rar
Spring Learning Note 1