Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Folder Mapping in web application.

 
Huang Jian Tian
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
hi Dave,
Sorry for my nickname, actually i was not notified by JavaRanch in the previous forum at http://www.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
  • 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
  • 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
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic