• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp page in WEB-INF

 
S. C.
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have creared a simple hello.jsp page and kept it under WEB-INF folder. but when I try to access it by using following url it gives me page not found error. why?
http://localhost:8080/web-inf/hello.jsp
 
tue march
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You are making little mistake in typing a url.it should look like the following

http://localhost:8080/application name/abc.jsp

remember to keep the .jsp file in application folder, that is the folder which contains your web-inf file.

you need to include any information of jsp in a web.xml file.

if any doubt revert back to me.

Thanks,
Good Guy
 
S. C.
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Good Guy,

But I have tried that also. My page works fine if I keep it in some other folder lets say page/hellp.jsp (URL: http://localhost:8080/application_name/page/hello.jsp)
but if I keep the jsp in web-inf folder (page folder and web-inf folder are at same level in directory structure) and try url http://localhost:8080/application_name/web-inf/hello.jsp, it gives me page not found error.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Learner, first of all change your display name because you will be asked for it.

For you information, JSPs inside the WEB-INF directory cant be accessed directly.
[ May 05, 2005: Message edited by: Adeel Ansari ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browsers can not access the WEB-INF directory directly.
Your JSPs and the WEB-INF directory should be in the root directory of your application.


Naming Policy
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"S. C.",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic