• 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

Folder Mapping in web application.

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
I would like to ask, is it possible for us to map a folder in web application?
For example, my web application contains a /images folder which contain all images used in my application. So, when I need to load a image from my jsp page, i would only required to specify something like images/myPic.gif instead of ../images/myPic.gif (note that ../images/myPic.gif is depend on how deep is the jsp file from the images folder).

Any response will be much appreciated. thanks
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"wanted",
You have already been wanred about your display name here.

Please see the link and update your profile with a valid display name soon, since accounts with invalid display names get deleted, often without warning.

thanks,
Dave.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a number of solutions, butI think the one you're looking for is to cretae a Servelt as a 'virtual directory'. To do this, you create a Servlet mapping which looks like a directory, then get the servlet to query the URL and serve the actual image. ie you create a mapping as */images/ and */images/* to your servlet, but I can't remember the actual method for getting the rest
 
Huang Jian Tian
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Dave,
Sorry for my nickname, actually i was not notified by JavaRanch in the previous forum at https://coderanch.com/t/75855/Websphere/Storage-Websphere-Embedded-JMS-Provider.
I've taken and change my displayed name to 'huang' which is my surname, is it ok?

Thanks for the suggestion, i will give it try...wish me good luck...:-)

huang
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for trying, but your name is still not valid.

We require your display name to be two words: your first name, a space, then your last name. Obviously fictitious names are not allowed.

Thanks for your cooperation.
Dave.
 
Huang Jian Tian
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi David,
OK, I will change my name accordingly. By the way, why i'm not being notified when someone reply to this topic?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't look like you've added an email address to your profile. I may be wrong, but nothing is showing.

Thanks for fixing your display name. All happy now
 
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

Originally posted by David O'Meara:
There are a number of solutions, butI think the one you're looking for is to cretae a Servelt as a 'virtual directory'. To do this, you create a Servlet mapping which looks like a directory, then get the servlet to query the URL and serve the actual image. ie you create a mapping as */images/ and */images/* to your servlet, but I can't remember the actual method for getting the rest



SimpleStream at http://simple.souther.us does this. In the example, I'm serving the images from a directory under WEB-INF. If you want to use it in production, you'll need to make sure you have mime types listed for every extension you plan to use. You'll see in in the servlet code.
[ January 16, 2005: Message edited by: Ben Souther ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic