I have a simple web project using default settings from eclipse. my web.xml has the default settings as:
If I put welcome.jsp file in webcontent folder it works, however I want to put the files in webcontent/web-inf/jsp flder inside web-inf folder.
I have tried doing in this way:
and it works. But I want to make this jsp folder as the default folder for webpages so that all the files will be pulled from this folder without giving any path. Can you please let me know how it can be done?
WEB-INF is a special folder and it and its contents cannot be accessed via a URL.
The reason you could put your welcome page under WEB-INF, is that the welcome page element applies to a resource path (directory/filename), and not a URL. Although URL and filename paths look confusingly alike, they very definitely are not the same thing, so different rules apply.
The only way to put JSP files under WEB-INF and get them served would be if some intermediary software could be persuaded to respond to a URL and access the JSP for you. For example, I put my JSF page templates under WEB-INF/layout and the Facelets processor reads and processes them.
BTW, we have a JSF forum and a JSP forum. This is the JSF forum, but your question is really more of a JSP question. You'll get better/more answers when you post to the right forum.
An IDE is no substitute for an Intelligent Developer.
Joined: Aug 09, 2011
Thanks for the answer.
Tim Holloway wrote:...BTW, we have a JSF forum and a JSP forum. This is the JSF forum, but your question is really more of a JSP question. You'll get better/more answers when you post to the right forum.
I am sorry about that, I read it too fast so posted in JSF instead of JSP. If a mod can help me in moving it to JSP forum then it will be great!