wood burning stoves 2.0*
The moose likes JSP and the fly likes Can I access a jsp page which is in WEB-INF folder? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Can I access a jsp page which is in WEB-INF folder?" Watch "Can I access a jsp page which is in WEB-INF folder?" New topic
Author

Can I access a jsp page which is in WEB-INF folder?

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Hi everybody, I am chaitanya, I have a doubt, Using the deployment descriptor, I can access the classes in the classes folder under WEB-INF.

Consider a scenario, I have a folder named jsps under WEB-INF folder, not can I access the jsps. If I can do so, please tell me how to do that, should I configure anything in the deployment descriptor.

Please help me. Thank you all in advance.


Love all, trust a few, do wrong to none.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

The whole purpose of putting JSPs under WEB-INF is to disallow directly addressing them. This is a good practice as the JSPs should only be available via their servlet controllers -- you can forward to JSPs under WEB-INF.

If that's not what you want, don't put them there.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Thank you Bear, but how can I do that. Can you please give me an example or any reference.

Thank you in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

You need information on how not to put a file in a folder?

If you want to access a JSP directly (should be rare), don't put it in WEB-INF.
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Bear Bibeault wrote:You need information on how not to put a file in a folder?

If you want to access a JSP directly (should be rare), don't put it in WEB-INF.


Thanks Bear, I want the information on how to access a webpage present in WEB-INF folder.

Thank you in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

Forward to the JSP from its page controller.
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Bear Bibeault wrote:Forward to the JSP from its page controller.


Thank you Bear, I will definitely try that one.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I access a jsp page which is in WEB-INF folder?
 
Similar Threads
fragment was not found error
image not displayed
prevent direct access after login.
Where to place?
how to access jsp under WEB-INF folder