Java Web 应用程序 Return 找不到错误 HTTP 404
Java Web Application Return Error HTTP 404 Not Found
我正在学习 java netbeans。我构建用于插入、更新和删除操作的 Web 应用程序。但是当我 运行 应用程序总是 returns 错误 404 未找到。
这是我想要 运行 的 HTML 代码。
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Add New</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Add New</h1>
<div style="width: 900px; margin-left: auto; margin-right: auto">
<form action="JSP/ManagerAddNew.jsp" method="post">
Title:<br>
<input type="text" name="title" style="width: 200px"><br>
Description:<br>
<input type="text" name="description" style="width: 200px"><br>
Detail:<br>
<textarea name="detail" style="width: 400px; height: 200px"></textarea><br>
Category:
<select name="category">
<option value="World">World</option>
<option value="Tech">Tech</option>
<option value="Sport">Sport</option>
</select><br>
Image:<br>
<input type="text" name="image" style="width: 200px"><br>
<input type="submit" value="Submit">
</form>
<!--Complete Interface Addnew.-->
</div>
</body>
</html>
这是错误消息的屏幕截图。
这是我的项目结构。
这是服务器的屏幕,应用程序已经部署。
我不知道 GlassFish Server,但是 tomcat。
WEB-INF文件夹下的一个JSP文件URL不能直接访问,可以这样访问:
request.getRequestDispatcher(“/WEB-INF/xxx.jsp”).forward(request,response);
我不确定这种方式是否可以解决GlassFish下的问题,希望对您有所帮助。
每当出现此类错误时,我都必须重新安装 glassfish 模块。
我正在学习 java netbeans。我构建用于插入、更新和删除操作的 Web 应用程序。但是当我 运行 应用程序总是 returns 错误 404 未找到。
这是我想要 运行 的 HTML 代码。
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Add New</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Add New</h1>
<div style="width: 900px; margin-left: auto; margin-right: auto">
<form action="JSP/ManagerAddNew.jsp" method="post">
Title:<br>
<input type="text" name="title" style="width: 200px"><br>
Description:<br>
<input type="text" name="description" style="width: 200px"><br>
Detail:<br>
<textarea name="detail" style="width: 400px; height: 200px"></textarea><br>
Category:
<select name="category">
<option value="World">World</option>
<option value="Tech">Tech</option>
<option value="Sport">Sport</option>
</select><br>
Image:<br>
<input type="text" name="image" style="width: 200px"><br>
<input type="submit" value="Submit">
</form>
<!--Complete Interface Addnew.-->
</div>
</body>
</html>
这是错误消息的屏幕截图。
这是我的项目结构。
这是服务器的屏幕,应用程序已经部署。
我不知道 GlassFish Server,但是 tomcat。 WEB-INF文件夹下的一个JSP文件URL不能直接访问,可以这样访问:
request.getRequestDispatcher(“/WEB-INF/xxx.jsp”).forward(request,response);
我不确定这种方式是否可以解决GlassFish下的问题,希望对您有所帮助。
每当出现此类错误时,我都必须重新安装 glassfish 模块。