jsp欢迎文件未调用

Cha*_*nya 2 java jsp tomcat

我有一个部署到tomcat的JSP Web应用程序.应用程序的URL是http:// servername/app

web.xml包含welcome-file-list,如下所示.

<?xml version="1.0" encoding="UTF-8"?>
    <web-app id="mobile" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
Run Code Online (Sandbox Code Playgroud)

现在,当我们访问http:// servername/app时,无法访问应用程序.但是,如果我们以http:// servername/app /访问该URL,则可以访问该应用程序.

我需要应用程序是没有试验/角色的应用程序.

请帮忙!

Bal*_*usC 10

当你有一个映射的servlet /接管servletcontainer的内置默认servlet的工作时,就会发生这种情况,该servlet 负责转到正确的根路径.因此,要么修复servlet以执行相同操作,要么将其映射到更具体的url模式.