还是帖个web.xml把。这样全面一些。说不定哪个牛人看到的话就帮你搞定了

解决方案 »

  1.   

    查看一下错误日志(如果是TOMCAT,则在\logs文件夹下),那里有很明显的错误提示信息
      

  2.   

    我想也是,把你的web.xml文件贴出来吧
      

  3.   

    好,这就是我的web.xml文件:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_3.xsd">
      <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>2</param-value>
        </init-param>
        <init-param>
          <param-name>detail</param-name>
          <param-value>2</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup> 
      </servlet>
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
     
      <taglib>
         <taglib-uri>/struts-html</taglib-uri>
         <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
         <taglib-uri>/struts-logic</taglib-uri>
         <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
         <taglib-uri>/struts-nested</taglib-uri>
         <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
      <taglib>
         <taglib-uri>/struts-tiles</taglib-uri>
         <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/struts-template</taglib-uri>
        <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
      

  4.   

    我以前也遇到了。刚解决。其实你在用myeclipse添加完后,将hibernate和spring的包从buildpath中移除,删除包。从hibernate和spring的网站上下在包添加进去(直接在eclipse里粘贴)。部署完后,启动服务。会提示少包,少甚么加甚么。
    通常在eclipse的目录下能够搜到,可以给个邮箱给你发一下
      

  5.   

    恩,谢谢楼上的朋友!!我已经试了N次各种各样的方法了,再试一回吧!!(但愿我们遇到的问题的实质是一样的,要不然,我又只有哭了)我的email:[email protected]感谢!!!!!
      

  6.   

    我曾经也遇到过这样的问题,是因为用<h:form>标签来提交action的,你仔细检查哈你的struts标签是不是确定引入了的~~
    我估计问题就在这里
      

  7.   

    想问11楼的朋友,你说将hibernate和spring的包从buildpath中移除,请问到底该移除那些文件呢?
      

  8.   

    啊 想问楼上的,如果什么struts的标签没引入,能够在myeclipse中部署成功吗??
      

  9.   

    我也遇见过这样的问题,但是一直找不到真正的原因.
    好象就是包倒入的不对.
    你换一个myeclipes版本试试吧
    我就是这样弄好的
      

  10.   

    <plug-in   className="org.springframework.web.struts.ContextLoaderPlugIn"> 
            <set-property   property="contextConfigLocation"   value="/WEB-INF/applicationContext.xml"   /> 
        </plug-in> 
    你的applicationContext.xml中有问题,仔细检查,因为applicationContext.xml的问题导致struts框夹不能完成加载.
      

  11.   

    问题不只在applicationContext.xml中,可能你的spring在依赖注入的时候有些对象不能正确创建也会导致spring加载错误,从而导致struts不能正确加载....
      

  12.   

    你在spring框架撤掉,你再看你的struts还会有问题吗?
      

  13.   

    啊 那样写也有问题啊?
    applicationContext.xml: 
      <beans> 
            <!--   DataBase   Configuration   --> 
            <!--   项目用到的数据源   --> 
    <bean   id="dataSource" 
    class="org.apache.commons.dbcp.BasicDataSource"> 
    <property   name="driverClassName"> 
    <value> com.mysql.jdbc.Driver </value> 
    </property> 
    <property   name="url"> 
    <value> jdbc:mysql://localhost:3306/orderticket </value> 
    </property> 
    <property   name="username"> 
    <value> root </value> 
    </property> 
    <property   name="password"> 
    <value> woaini1314 </value> 
    </property> 
    </bean> 
    <bean   id="sessionFactory" 
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 
    <property   name="dataSource"> 
    <ref   bean="dataSource"   /> 
    </property> 
    <property   name="hibernateProperties"> 
    <props> 
    <prop   key="hibernate.dialect"> 
    org.hibernate.dialect.MySQLDialect 
    </prop> 
    <prop   key="hibernate.show_sql"> true </prop> 
    </props> 
    </property> 
    <property   name="mappingResources"> 
    <list> 
    <value> org/zhangzhenxiang/vo/Admin.hbm.xml </value> 
    <value> org/zhangzhenxiang/vo/Flights.hbm.xml </value> 
    <value> org/zhangzhenxiang/vo/Orderitems.hbm.xml </value> 
    <value> org/zhangzhenxiang/vo/Orders.hbm.xml </value> 
    <value> org/zhangzhenxiang/vo/Users.hbm.xml </value> 
            </list> 
    </property> 
    </bean> 
    <bean   id="transactionManager"   class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 
          <property   name="sessionFactory"> 
            <ref   local="sessionFactory"/> 
          </property> 
    </bean> <bean   id="usersDAO"   class="org.zhangzhenxiang.dao.UsersDAO"> 
    <property   name="sessionFactory"> 
    <ref   local="sessionFactory"   /> 
    </property> 
    </bean> 
    <bean   name="/login"   class="org.zhangzhenxiang.struts.action.LoginAction"> 
                <property   name="usersDAO"> 
                  <ref   bean="usersDAO"/> 
                </property> 
            </bean> 
    这就是我的applicationContext.xml的一部分,你帮我看看哪里不对呢?急。
      

  14.   

    你用log4j了没?可以看到出错的信息!
      

  15.   

    在myeclipse中的控制台老是提示什么 no appender 反正是关于log4j
    可是不知道怎么用log4j,挨。
      

  16.   

    common-logging.jar  log4j.jar
    这些框架里都有日志信息.
    我怀疑: 你的spring 中某个 Bean实例实例化的时候有问题!applicationContext.xml文件应该没问题!
      

  17.   

    啊 如果spring   中某个   Bean实例实例化的时候有问题
     那一般可能是那里有问题呢?
      

  18.   

    先看看日志再说!bean不能实例化的情况挺多的.我没有总结过,不过我遇到的最多的就两个,一个是数据源有问题,导致sessinfactory不能实例化.一个是依赖注入的set方法不存在.其他的问题就是applicationContext.xml的错误了!
      

  19.   

    尝试删除hibernate-annotations.jar这个包看一下,我碰见过这个问题,这几天学习SSH,终于能整合成功了