LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1207|回复: 13

struts 问题

[复制链接]
发表于 2004-10-28 11:00:20 | 显示全部楼层 |阅读模式
在web.xml写好了struts的部分,启动时出现Error deploying web application directory ROOT java.lang.NoClassDefFoundError:javax/servlet/http/HttpServlet
这是怎么会事?还有叫查什么网站或者叫翻资料的回答不必了,如果这样我想我没必要来此发问,谢谢。
我的web.xml
[php]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Copyright 2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<web-app>
  <display-name>Welcome to Tomcat</display-name>
  <description>
     Welcome to Tomcat
  </description>

<!-- JSPC servlet mappings start -->

    <servlet>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>

        <servlet>
                <servlet-name>action</servlet-name>
                <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
                <init-param>
                        <param-name>application</param-name>
                        <param-value>ApplicationResources</param-value>
                </init-param>
                <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>org.apache.jsp.index_jsp</servlet-name>
        <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>

        <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>

<!-- JSPC servlet mappings end -->

<taglib>
        <taglib-uri>/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
</taglib>

<taglib>
        <taglib-uri>/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>

<taglib>
        <taglib-uri>/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>

<taglib>
        <taglib-uri>/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
</taglib>

<taglib>
        <taglib-uri>/struts-tiles</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>

<taglib>
        <taglib-uri>/struts-template</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-template.tld</taglib-location>
</taglib>
</web-app>

[/php]

etony更改标题
发表于 2004-10-28 13:07:01 | 显示全部楼层
java.lang.NoClassDefFoundError:javax/servlet/http/HttpServlet
tomcat找不到servlet.jar文件
 楼主| 发表于 2004-10-28 20:31:12 | 显示全部楼层

re

这个我知道,但是怎么解决呢?Thanks
发表于 2004-10-28 23:28:40 | 显示全部楼层
tomcat居然找不到servlet.jar???
 楼主| 发表于 2004-10-29 00:58:42 | 显示全部楼层

re

那我有什么办法,我也不想的。只是它就是这样,怎么解决?
发表于 2004-10-29 17:57:08 | 显示全部楼层
是不是你把servlet.jar从common/lib中删除了???
 楼主| 发表于 2004-10-30 15:19:21 | 显示全部楼层

re

绝对没有
发表于 2004-11-1 20:52:08 | 显示全部楼层
tomcat webapps 目录下的ROOT目录放了什么东东
发表于 2004-11-1 20:54:23 | 显示全部楼层
请看下webapps 下xml文件,和tomcat/conf/server.xml文件,这觉得应该是这哪个文件配置有问题。。。有没有手动修改过
 楼主| 发表于 2004-11-2 11:27:24 | 显示全部楼层

re

没有修改过,只是在ROOT下建立了我自己的目录
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表