首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

servlet 有关问题

2012-01-02 
servlet 问题先说一下自己的配置啊!!!C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat6.0\conf\Catalina

servlet 问题
先说一下自己的配置啊!!!
C:\Program   Files\Apache   Software   Foundation\Tomcat   6.0\conf\Catalina\localhost   目录下配置webApp.xml       内容为 <Context   path= "/webApp "   docBase= "F:\webApp "   reloadable= "true ">
</Context>
在F:\webApp目录下建有src   ,WEB-INF目录   WEB-INF目录下有classes目录和web.xml文件web.xml内容为
<?xml   version= "1.0 "   encoding= "gb2312 "?>
<!--
  Licensed   to   the   Apache   Software   Foundation   (ASF)   under   one   or   more
    contributor   license   agreements.     See   the   NOTICE   file   distributed   with
    this   work   for   additional   information   regarding   copyright   ownership.
    The   ASF   licenses   this   file   to   You   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   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 "
      version= "2.5 ">

    <display-name> Welcome   to   Tomcat </display-name>
    <description>
          Welcome   to   Tomcat
    </description>
<servlet>
<servlet-name> CreateDBServlet </servlet-name>
<servlet-class> CreateDBServlet </servlet-class>
<init-param>
<param-name> driverClass </param-name>
<param-value> com.mysql.jdbc.Driver </param-value>
</init-param>
<init-param>
<param-name> urll </param-name>
<param-value> jdbc:mysql://localhost:3306/mysql </param-value>
</init-param>
<init-param>
<param-name> user </param-name>
<param-value> root </param-value>
</init-param>
<init-param>
<param-name> password </param-name>
<param-value> 472958355 </param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name> CreateDBServlet </servlet-name>


<url-pattern> /createdb </url-pattern>
</servlet-mapping>
</web-app>
classes目录放有CreateDBServlet.class    
但我通过浏览器访问http://localhost:8080/webApp/createdb
显示一下信息HTTP   Status   404   -   Servlet   CreateDBServlet   is   not   available

--------------------------------------------

type   Status   report

message   Servlet   CreateDBServlet   is   not   available

description   The   requested   resource   (Servlet   CreateDBServlet   is   not   available)   is   not   available.


--------------------------------------------

Apache   Tomcat/6.0.13
说Servlet   CreateDBServlet   is   not   available       为啥啊???我配置没错误啊!!!

[解决办法]
http://localhost:7001/webApp/
这样,你看看进的是哪个工程!

热点排行