Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Link on image in JSP page  RSS feed

 
Ranch Hand
Posts: 42
  • 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: 67226
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: 42
  • 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]
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!