• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is my jsp not available?

 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have a very small jsp-servlet application. Name of the application is myfirstwebapp. I have a folder structure like the following :
Tomcat --> webapps --> myfirstwebapp --> WEB-INF

Inside my WEB-INF, I have my classes folder and the web.xml file. Along with the web-inf folder, I also have helloworld.jsp in the myfirstwebapp folder. When I start Tomcat and type http://localhost:8080/myfirstwebapp/helloworld, the browser throws a 404 error and says "requested resource() not available"
I double checked and all names etc are correct, so its not a case of my application name being myfirstwebapp and me typing myfistwebapp....or something like that. Another thing that I found out is...if I remove the web.xml file from the project folder, the web page becomes available, but the moment I put it back, the page becomes unavailable again.
Can you please help me find out my error?

Thanks in advance for all your help.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the page is named "helloworld.jsp", then that's what you need to use in the URL, not just "helloworld".
 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried even that...and yet its not able to find
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the jsp located ?
can you please add a screenshot of the directory structure ?
 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here are the 2 screenshots. One of them shows the directory structure till the jsp, while the other shows the error that the browser gives when I try to run the page
folder_structure.jpg
[Thumbnail for folder_structure.jpg]
Folder Structure till the jsp. The web.xml file is inside the WEB-INF folder
error.jpg
[Thumbnail for error.jpg]
This is the error that is thrown by the browser
 
Ulf Dittmer
Rancher
Posts: 42967
73
 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried after I read your post. It doesnt work. But since my page is named helloworld.jsp, and not helloworld.html...isnt that expected?
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Souvvik Basu wrote:I tried after I read your post. It doesnt work. But since my page is named helloworld.jsp, and not helloworld.html...isnt that expected?

What you get when you access the html file?
But since my page is named helloworld.jsp, and not helloworld.html...isnt that expected?

Both should be accessible if everything is alright...
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Souvvik Basu wrote:It doesnt work. But since my page is named helloworld.jsp, and not helloworld.html...isnt that expected?

Re-read my post carefully - I was asking about firstpage.html, not helloworld.html. Reason being that the file is part of your web app.
 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry...missed out that part. No, even that is not available. But as I said, it gets available (both of them) if I remove the web.xml file from the WEB-INF folder.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any error messages in the log files?
 
Matthew Brown
Bartender
Posts: 4567
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be worth posting the web.xml file, as it sounds like the issue is probably there.
 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the web.xml file



I didnt find any error messages in the log file.
I just made a fresh web application, and this time, the problem is gone. The web pages are available, even though the directory structure is same as the previous one. I'm not sure if it was a case of some internal problem with Tomcat itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic