java吧 关注:1,292,970贴子:12,824,110
  • 3回复贴,共1

struts2和servlet并用冲突问题请神入

只看楼主收藏回复

本人菜鸟一只,不懂配置文件,求指导,配置文件如下
<?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">
<!-- spring config -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Spring Encoding Filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<!-- Spring Encoding Filter Mapping -->
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>sessionFactory</param-value>
</init-param>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>UpLoadUserHeadImage</servlet-name>
<servlet-class>com.servlet.UpLoadUserHeadImage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UpLoadUserHeadImage</servlet-name>
<url-pattern>/servlet/UpLoadUserHeadImage.servlet</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ZoomImage</servlet-name>
<servlet-class>com.servlet.ZoomImage.servlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ZoomImage</servlet-name>
<url-pattern>/servlet/ZoomImage.servlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/page/login/index.html</welcome-file>
</welcome-file-list>
</web-app>


IP属地:内蒙古1楼2013-12-19 19:33回复
    help啊


    IP属地:内蒙古2楼2013-12-19 19:35
    回复
      2025-12-29 20:23:40
      广告
      不感兴趣
      开通SVIP免广告
      你为何这么叼,还在用servlet


      IP属地:福建3楼2013-12-19 23:55
      收起回复