web.xml的问题
我的web应用写的web.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp">
<display-name>CCAS</display-name>
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>CMain</servlet-name>
<display-name>CMain</display-name>
<servlet-class>com.visionsky.controls.Main</servlet-class>
<init-param>
<param-name>log4j</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</init-param>
<init-param>
<param-name>ImageRoot</param-name>
<param-value>/imgdoc/</param-value>
</init-param>
<init-param>
<param-name>maxUploadSize</param-name>
<param-value>5024000</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CMain</servlet-name>
<url-pattern>/CMain</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>BLogon.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<res-ref-name>jdbc/CCASDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>UnShareable</res-sharing-scope>
</resource-ref>
</web-app>
奇怪的是当加上过滤器时:
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
我的servlet在服务器启动的时候就不会被加载,但去掉上面<filter>标签段,servlet就可以在服务器启动的时候被加载,
不知是什么原因,求各位大虾帮忙???
[解决办法]
要么缺包,要么包冲突,总之包的问题
[解决办法]