user1375948
user1375948

Reputation: 177

Tomcat 404 Error on simple JSP webpage

I have made a simple dynamic web project in eclipse with tomcat When i run my index.jsp file it throws 404 error. Below is screenshot of my web project

Project Hierarchy

As you can see index.jsp is located inside Web Content Folder but it still show 404 error Also when i run it on my firefox browser it raises same 404 error but localhost:8080 shows tomcat home page so its working fine

Can anyone tell me what am i doing wrong here?

Upvotes: 4

Views: 6674

Answers (2)

Syed Aaqib Hussain
Syed Aaqib Hussain

Reputation: 139

In Eclipse check the following properties.

Go to the Project Properties -> Deployment Assembly -> /WebContent, Check the source location of for deploying the JSP’s, here the path is /WebContent, this is the location where the JSP’s need to be added not in /WEB-INF

enter image description here

What this means is that you need to put the JSP's directly in /WebContent directory not inside the /WEB-INF directory.

enter image description here

Upvotes: 0

user2691659
user2691659

Reputation:

Sometimes as JB said it may not have been correctly deployed reason being that the web.xml file was not valid. Restarting the server deletes old(maybe corrupted) files and generates new web files which are needed to run your app. I use glassfish and sometimes when i make very significant changes to my project, i restart the server to reflect or those changes correctly by generating new files based on them. Sometimes saving and running is not enough since it doesn't overwrite all the required.

Upvotes: 2

Related Questions