aspose file tools*
The moose likes JSP and the fly likes Jsp page in WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp page in WEB-INF" Watch "Jsp page in WEB-INF" New topic
Author

Jsp page in WEB-INF

S. C.
Greenhorn

Joined: May 05, 2005
Posts: 2
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

Joined: Mar 09, 2005
Posts: 16
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

Joined: May 05, 2005
Posts: 2
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

Joined: Aug 15, 2004
Posts: 2874
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

Joined: Dec 11, 2004
Posts: 13410

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


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60991
    
  65

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp page in WEB-INF