簡體   English   中英

HTTP狀態404 JSP文件(沒有servlet,沒有目錄失敗)

[英]HTTP status 404 JSP File (no servlet no directory fail)

在發布此信息之前,我已經搜索了幾個小時。 我試圖將普通的.jsp文件引用到另一個文件中,但是我收到HTTP狀態404錯誤。

這是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。

先感謝您。

我解決了自己。 Windows中的TomEE服務存在問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM