今天整合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>

解决方案 »

  1.   

    看看你的tomcat里面有木有这个项目,路径是否正确,端口号是否正确
      

  2.   

    ssh的整合需要分步整合,先spring和hibernate,然后整合struts。一步一步的调试通过才行。一般是你的路径不对吧!仔细检查一下!
      

  3.   

    在整合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错误了。
      

  4.   

    在整合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错误了。
      

  5.   

    [Quote=引用 3 楼 super_ninja 的回复:]ssh的整合需要分步整合,先spring和hibernate,然后整合struts。一步一步的调试通过才行。一般是你的路径不对吧!仔细检查一下!
    [/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]
      

  6.   

    struts1如何集成 怎么配置还真没用过,你在网上搜索一下配置模板看一下吧!