@RequestMapping("/login2");
用于处理请求地址的注解,这里指来至login2.jsp页面的请求,
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>*.spring</url-pattern>
</servlet-mapping>
org.springframework.web.servlet.DispatcherServlet配置了以*.spring结尾,所以处理后的路径为login2.spring