How to access a jsp page inside a folder under WEB-INF?

How to access a jsp page(itemDetails.jsp) inside a folder(product) under the WEB-INF?

Located on my computer
C:\Myapp\WEB-INF\product\itemDetails.jsp

http://localhost:8080/myapp/....

myapp is the Web Context name
product is a folder that store the itemDetails.jsp file

I keep getting a HTTP Status 404 error
coffee_beanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rrzCommented:
The WEB-INF is not accessable to the browser. Put your "product" folder outside of WEB-INF.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bloodredsunCommented:
As rrz@871311 says, you can't as the WEB-INF is not visible to the browser

The only way you could do it is to have a forwarding page that does a forward on the server.

forward.jsp
---------------------
<%
request.getRequestDistpatcher("WEB-INF/product/itemDetails.jsp").forward( request, response) ;
%>
0
neonlinesProject managerCommented:
Try

http://localhost:8080/myapp/product/itemDetails.jsp 

It will work if ur Web Context Path points to C:\Myapp\WEB-INF and ur Web Context Name is myapp


0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

udilipkumarCommented:
As rrz says, we cant access a jsp page placed under the WEB-INF using http://localhost:8080/

The option you have is to move the product folder outside WEB-INF.

This is because the servlet context cannot allocate servlet instance for the path through which u access your jsp in the WEB-INF. It looks for the servlet class or a class it depends on  which it fails to....

Hope this helps

Dilip
0
coffee_beanAuthor Commented:
Hi All thanks so much, I put the jsp file outside WEB-INF and I can access to that page now.
0
coffee_beanAuthor Commented:
Hmm...how come I can't split the point? I have increase the pt to 30 and wanted to split to each of u. I will check with the mod and come back to award the pt again.
0
VenabiliCommented:
You need to have at least 20 points per expert to make a split.
0
coffee_beanAuthor Commented:
Thanks everyone.  But just wondering if I put the jsp file into a folder outside the WEB-INF, wouldn't this make the page less secure as it can be easily accessed?
0
bloodredsunCommented:
But a JSP is supposed to be seen. You need to look at the topics of Authentication and Authorization if you only want certain people to look at the page.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.