疑问,运行Servlet配置web.xml时出现问题
程序代码:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www. xmlns:web="http://xmlns. xsi:schemaLocation="http://xmlns. http://java.class>filter.EncodingFilter</filter-class> </filter> <filter-mapping> <filter-name>EncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>DealServlet</servlet-name> <servlet-class>servlets.DealServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>DealServlet</servlet-name> <url-pattern>/servlet/DealServlet</url-pattern> </servlet-mapping> <filter> <filter-name>EncodingFiter</filter-name> <filter-class>filter.EncodingFilter</filter-class> </filter> <filter-mapping> <filter-name>EncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
偶然试出来的,第一段和第三段是重复的,当时以为位置可能有要求。后来反复试了好几次,只有这种情况,tomcat才能启动。
求问:这是个什么原理???