Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 为什么在带有DD的web项目中找不到index.jsp_Eclipse_Jsp - Fatal编程技术网

Eclipse 为什么在带有DD的web项目中找不到index.jsp

Eclipse 为什么在带有DD的web项目中找不到index.jsp,eclipse,jsp,Eclipse,Jsp,请原谅,我是Java网络世界的新手,我正试图为测试编写一个web项目。但似乎我没有得到我预期的结果。我不知道会发生什么。请帮我复习一下。以下是我到目前为止所做的 在Eclipse中使用选项Generate web.xml DD创建一个名为MyFirstWeb的动态web项目 在WebContent目录下添加一个index.jsp。下面是其中的页面代码 我的头衔 今天的日期是,这个jsp页面工作了! 在我将其发布到Eclipse中的内置Tomcat服务器运行时之后。服务器启动时没有错误。 但是

请原谅,我是Java网络世界的新手,我正试图为测试编写一个web项目。但似乎我没有得到我预期的结果。我不知道会发生什么。请帮我复习一下。以下是我到目前为止所做的

  • 在Eclipse中使用选项
    Generate web.xml DD
    创建一个名为
    MyFirstWeb
    的动态web项目
  • WebContent
    目录下添加一个
    index.jsp
    。下面是其中的页面代码
  • 
    我的头衔
    今天的日期是,这个jsp页面工作了!
    
    在我将其发布到Eclipse中的内置Tomcat服务器运行时之后。服务器启动时没有错误。 但是我得到了一个空的url页面
    http://localhost:8080/MyFirstWeb/index.jsp
    ,为什么?谢谢。

    添加到您的web.xml

    <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    
    
    index.jsp
    
    添加到web.xml

    <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    
    
    index.jsp
    
    我在Eclipse中使用了您的精确代码,它工作得非常好。你能告诉我错误是什么吗。? 并检查您的web.xml是否具有此功能

    <?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>MyFirstWeb</display-name>
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
    
    
    MyFirstWeb
    index.jsp
    
    我在Eclipse中使用了您的精确代码,它工作得非常好。你能告诉我错误是什么吗。? 并检查您的web.xml是否具有此功能

    <?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>MyFirstWeb</display-name>
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
    
    
    MyFirstWeb
    index.jsp
    
    嗯,我刚刚删除了原始项目,并按照说明重新创建了它,但效果很好。我再也找不到了(无论如何,在我创建项目时,您答案中的xml内容是默认内容。。谢谢。我刚刚删除了原始项目,并按照说明重新创建了它,但效果很好。我再也找不到了。:(无论如何,在我创建项目时,您答案中的xml内容是默认内容..谢谢。您能否解释如何像在Netbeans中一样自动执行此操作?您能否解释如何像在Netbeans中一样自动执行此操作??