Java 不显示欢迎页面JSP

Java 不显示欢迎页面JSP,java,angularjs,jsp,web-inf,welcome-file,Java,Angularjs,Jsp,Web Inf,Welcome File,我在eclipse中创建了动态web项目,并添加了index.jsp文件,这显然是我的欢迎页面。我在web.xml中添加了它,我正在使用angular js进行前端界面管理 这是我的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

我在eclipse中创建了动态web项目,并添加了index.jsp文件,这显然是我的欢迎页面。我在web.xml中添加了它,我正在使用angular js进行前端界面管理

这是我的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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="false" version="3.0">
<welcome-file-list>

    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
    <servlet>
    <description></description>
    <display-name>ValidateLogin</display-name>
    <servlet-name>ValidateLogin</servlet-name>
    <servlet-class>ValidateLogin</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ValidateLogin</servlet-name>
    <url-pattern>/ValidateLogin</url-pattern>
  </servlet-mapping>

</web-app>
这是我的目录结构

问题是什么?有人能回答吗

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

根据您的服务器更改端口号。您需要提供用于访问jsp的项目url。假设您在服务器上部署了4个项目,每个项目都有index.jsp。如果您不提供项目url,容器将如何确定要运行哪个index.jsp。

您提到的欢迎文件没有任何文件扩展名

     <welcome-file>index</welcome-file>
索引
如果您的文件是index.jsp,只需添加具有文件扩展名的有效欢迎页面

   <welcome-file>index.jsp</welcome-file>
index.jsp
您的$routeProvider配置不会影响您在web.xml中提到的欢迎页面加载。路由提供程序仅在加载角js后生效

  • 请确保如下所述提及欢迎文件属性: index.jsp

  •    <welcome-file>index.jsp</welcome-file>
    
  • 确保index.jsp与WEB-INF并行


  • 希望这能起作用。

    文件名正确吗?请注意,您没有在web.xml中提供
    .jsp
    扩展名,它应该是
    index.jsp
    ,您是否尝试过使用index。jsp@Sridhar我已经尝试了所有的方法。但是还是一样。“但是如果我添加了项目url+index.jsp,那么页面加载成功”你在哪里添加它,请详细说明
    index.jsp
    文件存在的地方,你能发布文件夹结构吗?你在添加项目url时在问题中写道jsp加载很好。是的。。正如你提到的,我已经编辑了web.xml。但是它没有加载欢迎页面。重新阅读你的问题,jsp加载是什么意思。现在你说不加载欢迎页面我可以打开欢迎页面,如果我输入了它的绝对路径,比如。。但当我运行项目或键入localhost:8080/application/时,它没有加载。这个问题发生在我身上;一些解决办法;清除服务器缓存,重新启动服务器;删除web.xml,再放一个;创建新应用程序并复制代码
       <welcome-file>index.jsp</welcome-file>