今天下了个eclipse3.7 Eclipse IDE for JavaScript Web Developers.
配置了Tomcat 6.0
jdk一直用的1.7
照着视频配置完后页面可访问到index.jsp
可是过了一会发现web.xml不见了
到工程目录里也没找到,显示隐藏文件了也没没有
关掉eclipse,重启tomcat 还是可以访问到index.jsp
谁知道这是怎么回事呢
今天才学Servlet啊 

解决方案 »

  1.   

    你是不是新建 Dynamic  Web Project ,最后一步:
    Web Module中的 
    Generate web.xml deployment descriptor  没有打上勾啊
      

  2.   


    就是说上面的那样.
    另外那个没有的话 自己拷贝一个以前项目的web.xml进来就是了噻 删掉多余内容 都是一样的
      

  3.   

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
      <display-name>jsj_jdbc2</display-name>
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
      

  4.   

    今天才看Servlet,不懂Dynamic  Web Project是什么,刚看了下Eclipse Java EE IDE for Web Developers.版eclipse 新建里面是有个Dynamic  Web Project
    但是我是用Eclipse IDE for JavaScript Web Developers.建的Java Project 
    里面建了WebRoot文件夹,它下面建了WEB-INF文件夹
    WEB-INF下面建了classes文件夹 ,指定了输出文件到这个文件夹中,同时WEB-INF里面写了web.xml
    WEBROOT下面写了个index.jsp
    后来我看classes文件夹和web.xml都不见了 .....
    求指教