MyEclipse中出现404错误,应该是web.xml文件的配置问题,但是我找不到问题在哪,下面是web.xml文件的代码 5
<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="2.5"xmlns="http://java.sun.com/x...
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>ActionServlet</servlet-name>
<servlet-class>
com.bus.baseAction.ActionServlet
</servlet-class>
<!-- 配置>=0的数,就可以让servlet启动时被web容器加载,注意:值越大,被加载的优先级越低 -->
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/mvc-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>com.bus.common.filter.EncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.let</url-pattern>
</filter-mapping>
<servlet-mapping>
<servlet-name>ActionServlet</servlet-name>
<url-pattern>*.let</url-pattern>
</servlet-mapping>
<context-param>
<param-name>parserPackage</param-name>
<param-value>com.bus.bean</param-value>
</context-param>
<listener>
<listener-class>com.bus.common.listener.InitSQLCacheListener</listener-class>
</listener>
<servlet>
<servlet-name>ServletDAOTest</servlet-name>
<servlet-class>com.bus.test.ServletDAOTest</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletDAOTest</servlet-name>
<url-pattern>/daotest</url-pattern>
</servlet-mapping>
</web-app> 展开
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>ActionServlet</servlet-name>
<servlet-class>
com.bus.baseAction.ActionServlet
</servlet-class>
<!-- 配置>=0的数,就可以让servlet启动时被web容器加载,注意:值越大,被加载的优先级越低 -->
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/mvc-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>com.bus.common.filter.EncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.let</url-pattern>
</filter-mapping>
<servlet-mapping>
<servlet-name>ActionServlet</servlet-name>
<url-pattern>*.let</url-pattern>
</servlet-mapping>
<context-param>
<param-name>parserPackage</param-name>
<param-value>com.bus.bean</param-value>
</context-param>
<listener>
<listener-class>com.bus.common.listener.InitSQLCacheListener</listener-class>
</listener>
<servlet>
<servlet-name>ServletDAOTest</servlet-name>
<servlet-class>com.bus.test.ServletDAOTest</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletDAOTest</servlet-name>
<url-pattern>/daotest</url-pattern>
</servlet-mapping>
</web-app> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询