• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Link on image in JSP page  RSS feed

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
   Hello!
   I try to create in jsp-page a link on image, which lies in local-directory. But without success: image is not displayed in page.
   

 
   The structure of project

   
Structure.png
[Thumbnail for Structure.png]
 
Marshal
Posts: 67255
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
localhost always resolves to the system that the browser is running upon. So your URL is instructing the browser to look on the users' computer for the image, which of course isn't going to be found.

You should be using a server-relative URL that starts with the context path. See the JspFaq for more information on properly formatting resource URLs in Java web applications.
 
Andrey Dmitriev
Ranch Hand
Posts: 62
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 Thanks, Bear Bibeault!
 
  That article  helped me


  I solved the problem, by using:


 
New-Structure.png
[Thumbnail for New-Structure.png]
 
Let me tell you a story about a man named Jed. He made this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!