I'm following this example, I created a index.jsp
file in the project WebApplication1
with the following code:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>First JSP Page</title>
</head>
<body>
<h1>Today's date</h1>
Date and Time: <%= (new java.util.Date().toString())%>
</body>
</html>
The file is located in WEB-INF
folder. Following the tutorial instructions, I built the project (success), then I ran it (also no exceptions). But when I go to localhost:8080/WebApplication1
' it shows 404
mistake. I also tried the localhost:8080/WebApplication1/index
with the same result..
EDIT1: I also tried to copy the WebApplication1
folder from where Netbeans places it and pasting it into tomcat/webapps
and running the simpliest index.html
with the same (404
) result..
EDIT2: Figured out the solution - the localhost:8080/WebApplication1/web/index.jsp
works fine!