-1

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!

parsecer
  • 4,758
  • 13
  • 71
  • 140
  • @BalusC, Thank you, I'll look into oracle tutorials. But the suggested answer (placing index.jsp outside the WEB-INF folder) didn't work for me.. – parsecer Sep 08 '16 at 11:20

1 Answers1

1

Move your index.jsp outside the WEB-INF folder. According to the Tutorial, the index.jsp is not IN the WEB-INF folder but actually it is IN the web folder.

web/WEB-INF/index.jsp should be web/index.jsp

Arty
  • 819
  • 3
  • 13
  • 24