Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to put jsp files in a folder in a web project?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Saloon Keeper
Posts: 25466
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ted Trip
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

Thanks!
 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic