In dynamic Web Project I have - default.html page
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="./Styles/Site.css" type="text/css" />
<title>Create new customer</title>
</head>
<body>
<a href="\WEB-INF\forms\CustomerMenu.jsp">Test new</a>
</body>
</html>
I have also the CustomerMenu.jsp page -
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="./Styles/Site.css" type="text/css" />
<title>Create new customer</title>
</head>
<body>
// Table ..
</body>
</html>
The pages hierarchy is as the snapshot -
When I press on the link in default.html I get error message
- HTTP Status 404 -
--------------------------------------------------------------------------------
type Status report
message
description The requested resource () is not available.
Insert the following tag after the tag: <%= new java. util. Date() %>. The <% and %> are JSP tags that specify an action needs to be taken with the function that is provided.
Complete HTML/CSS Course 2022 To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the hyperlink starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a hyperlink.
JSP provides a dynamic interface for the continuously changing data and also it dynamically invokes the server actions. HTML provides a means to give a detailed account of the structure of text-based information in a document. JSP generated dynamic web pages only. Whereas Html generated static web pages only.
Files in /WEB-INF
folder are not publicly accessible without using a front controller servlet or a specific tag like <jsp:include>
which does either a RequestDispatcher#forward()
or RequestDispatcher#include()
.
If you need to access a JSP file directly by URL, then you should not be placing the JSP in /WEB-INF
folder. Put it outside the /WEB-INF
folder
WebContent
|-- forms
| |-- CreateNewCustomer.html
| |-- CustomerMenu.html
| `-- CustomerMenu.jsp
|-- WEB-INF
: :
and fix the link accordingly.
<a href="forms/CustomerMenu.jsp">Test new</a>
WEB-INF
folder is not accessible outside.
You will either need to move the jsp outside of WEB-INF
or use forward request to forward to the jsp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With