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

how to produce dynamic path of searched file?

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is in my jsp

This is in my servlet:

My question is, how to make this dynamic?
i mean i don't want to write hardcoded of the address path.

i have tried


i also have tried

but the address returned was:


what i really want is:


I would greatly appreciate it if you kindly give me some feedback. thanks.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you post a new topic when we already have a conversation here?. Do you want to waste the community's time having someone else answer questions we've already covered?

I already answered why this doesn't work in your previous topic:


As for this code:

You don't tell us where your image is located. In your previous topic, I told you that you needed to package the image with your web application. Did you do that? The javadoc for Class explains the rules the class loader uses to find a resource.

 
derick nial
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You don't tell us where your image is located.


the image is in here----> C:\Users\Acer\Desktop\mine\images\Extra\sunset.jpg

In your previous topic, I told you that you needed to package the image with your web application.


how to do this?
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

derick nial wrote:

You don't tell us where your image is located.


the image is in here----> C:\Users\Acer\Desktop\mine\images\Extra\sunset.jpg



Why does it have to be this directory? When you deploy your application to another computer, someone have to create an "Acer" user on that machine in order to put an image in that directory.

derick nial wrote:

In your previous topic, I told you that you needed to package the image with your web application.


how to do this?



How are you deploying your application?
 
Are we home yet? Wait, did we forget the tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic