• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

root directory of a web app

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it seems like there are some inconsistencies about what is the root directory of a java web app...

i have the following directory structure:
mywebapp


and then i have in a web page



that's not exactly what i am doing because I am using EL to specify the folder locations dynamically (i.e. ${initParam.imgdir}/pic.jpg) but i think it is the same..

anyway it looks like the include directive works properly but the image dir is looking a directory above the webapp dir (i.e. http://localhost/img/pic.jpg instead of http://localhost/mywebapp/img/pic.jpg)

why is it not looking for img in the root of the web app directory and can i change it so it does work?
[BSouther: Added UBB CODE tags]
[ July 08, 2007: Message edited by: Ben Souther ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not an inconstancy in the way Java works.
Your comparing client side, markup code with server side JSP code.

You image tag is just text as far as the JSP interpreter is concerned.
It just sends it to the browser, verbatim.
The JSP tags, on the other hand are interpreted on the server.
Since your browser knows nothing about server side Java apps, it has now way of knowing what your context path is unless you specify it.

 
reply
    Bookmark Topic Watch Topic
  • New Topic