今天整合ssh的时候老是报404错误.和台一点异常信息都没有,这是相关配置文件
边项目目录都进不去web.xml
-----------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation
</param-name>
<param-value>classpath:applicationContext.xml
</param-value>
</context-param>
<!-- 加载spirng配置文件 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener;
</listener-class>
</listener>
<!-- 配置struts -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
边项目目录都进不去web.xml
-----------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation
</param-name>
<param-value>classpath:applicationContext.xml
</param-value>
</context-param>
<!-- 加载spirng配置文件 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener;
</listener-class>
</listener>
<!-- 配置struts -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
<param-name>contextConfigLocation
</param-name>
<param-value>classpath:applicationContext.xml
</param-value>
</context-param>
<!-- 加载spirng配置文件 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener;
</listener-class>
</listener>
这一段项目就没法访问了。接着把这段注释掉也没用。然后我把这个web.xml文件替换掉其它以用的项目中的web.xml文件再重新换回来的时候原来可以用的项目竟然也报404错误了。
<param-name>contextConfigLocation
</param-name>
<param-value>classpath:applicationContext.xml
</param-value>
</context-param>
<!-- 加载spirng配置文件 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener;
</listener-class>
</listener>
这一段项目就没法访问了。接着把这段注释掉也没用。然后我把这个web.xml文件替换掉其它以用的项目中的web.xml文件再重新换回来的时候原来可以用的项目竟然也报404错误了。
[/Q在整合hibernate的事候用单元测试没问题,但是整合struts的时候。在web.xml文件加了<context-param>
<param-name>contextConfigLocation
</param-name>
<param-value>classpath:applicationContext.xml
</param-value>
</context-param>
<!-- 加载spirng配置文件 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener;
</listener-class>
</listener>
这一段项目就没法访问了。接着把这段注释掉也没用。然后我把这个web.xml文件替换掉其它以用的项目中的web.xml文件再重新换回来的时候原来可以用的项目竟然也报404错误了。uote]