• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not getting path

 
Kasparov Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

My directory structure are as follow:

I am not able to access any file in home.jsp. I tried to gave all kind of path in home.jsp such as ./css/logo.jpg, WEB-INF/css/logo.jpg, or ./WEB-INF/css/logo.jpg.

Can anyone help me?

Regards,
Kasparov
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything inside the WEB-INF folder is not accessible directly, only if you include it from a servlet or JSP, and with that I do not mean inside the HTML code itself (e.g. as the source of an image). Just move these folders outside the WEB-INF folder unless you really want them to be inaccessible.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As already pointed out, script files, stylesheets and images need to be outside WEB-INF to be used from browser pages.

JSPs should remain under WEB-INF so that they are not directly accessible, but only available through their page controllers.

And be sure to use server-relative paths that start with the context path in your pages to all of the images, script file and stylesheets. See the JspFaq for more info.
 
Kasparov Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic