Reputation: 177
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
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
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
What this means is that you need to put the JSP's directly in /WebContent directory not inside the /WEB-INF directory.
Upvotes: 0
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