| | |
| | | |
| | | <!--在web项目中注册SpringMVC的控制器:把所有的请求都交给spring的控制器处理--> |
| | | <!--Single Page Application--> |
| | | |
| | | <servlet> |
| | | <servlet-name>springDispatcherServlet</servlet-name> |
| | | <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
| | |
| | | <param-value>classpath:spring-servlet.xml</param-value> |
| | | </init-param> |
| | | <load-on-startup>1</load-on-startup> |
| | | <multipart-config/> |
| | | </servlet> |
| | | |
| | | <servlet-mapping> |
| | |
| | | <filter-name>encodingFilter</filter-name> |
| | | <url-pattern>/*</url-pattern> <!-- 设置过滤器的作用路径 --> |
| | | </filter-mapping> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <welcome-file-list> |
| | | <welcome-file>index.jsp</welcome-file> |
| | | </welcome-file-list> |
| | | |
| | | <error-page> |
| | | <error-code>404</error-code> |
| | | <location>/error_page/error_400/page_1/404.html</location> |
| | | </error-page> |
| | | <error-page> |
| | | <error-code>405</error-code> |
| | | <location>/error_page/error_400/page_1/404.html</location> |
| | | </error-page> |
| | | <error-page> |
| | | <error-code>500</error-code> |
| | | <location>/error_page/error_500/page_2/500.html</location> |
| | | </error-page> |
| | | |
| | | |
| | | <security-constraint> |
| | | <web-resource-collection> |
| | | <web-resource-name>Protected Servlet</web-resource-name> |
| | | <url-pattern>/servlets/servlet/SessionExample</url-pattern> |
| | | </web-resource-collection> |
| | | <auth-constraint> |
| | | <!-- 无人可访问 --> |
| | | <role-name>none</role-name> |
| | | </auth-constraint> |
| | | </security-constraint> |
| | | </web-app> |
| | | |