0
我发邮件数小时后发布。 我试图将正常的.jsp
文件引用到另一个文件中,但我收到HTTP状态404错误。HTTP状态404 JSP文件(没有servlet没有目录失败)
这是的index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<a href="user.jsp">LINK</a>
</body>
</html>
的user.jsp位于/ web文件夹(带的index.jsp),而不是一个servlet。
我也创造了的web.xml文件(谷歌搜索,但我知道,没有必要到正常.jsp文件登记)为如下:
<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_3_0.xsd"
version="3.0">
<display-name>test</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>user.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
的错误是一样的如果我删除条目welcome-file-list
。
我使用的是TomEE 1.7.4。
预先感谢您。
你能详细介绍一下你项目的文件树吗?你的工作空间怎么样?在交付时如何(战争文件或爆炸战争)。例如,我主要关心您的Web文件夹所在的位置,例如WEB-INF文件夹。 –
如果user.jsp和index.jsp都在相同的路径中,它应该可以工作。 – notionquest