• 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

How to bind images and text together in same jsp page in easiest way?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here i am sending you my code for simple navigation page...!

Can anyone tell me the way to get my image in this page along with Text and where i need to put it inside my netbeans project ??


I have created images folder inside /WEB-INF folder...!

/WEB-INF/Images/Forward.jpg Is it correct ??
Code from file nevigation.jsp



What i should write in src=" ??? "

I have tried everything

1. /images/Forward.jpg
2. /WEB-INF/images/Forward.jpg
3. /localhost:8081/Car_Dynamic_Demo/images/Forward.jpg
4. D:\study\ADVANCE_JAVA\PrOgRaMs\WEB_APPS\Car_Dynamic_Demo\web\WEB-INF\images\Forward.jpg

But nothing is working for me...!

IS IT PROBLEM OF MOZILLA FIREFOX ??? OR DYNAMICALLY GENERATED PAGES are faulty somewhere???

Hoping for best and quick solution....!

Thanks....!
directory.jpg
[Thumbnail for directory.jpg]
Is it correct File hirarchy ??
errorPageCode.jpg
[Thumbnail for errorPageCode.jpg]
Snap shot of Error page
 
Ranch Hand
Posts: 147
Eclipse IDE Tomcat Server Debian
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WEB-INF is a special folder, and the application server typically (if not always) does not allow content to be served directly from this folder. Your web application can access files under this folder, but you can't simply request /MyApp/WEB-INF/Images/myimage.png in the browser. You'd actually need to create some sort of handler to stream that file.

It's probably far easier to simply move those images outside of the WEB-INF folder, to a location they can be requested directly by the browser.


 
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you move the image folder don't forget to add security-constraint for that, since this can be viewed by direct URL of any browser.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kumaravadivel Subramani wrote:When you move the image folder don't forget to add security-constraint for that, since this can be viewed by direct URL of any browser.


Why would he do that? The whole point is to allow the images to be viewed. If a security restraint is placed on the images, then they won't show up.
 
I can't take it! You are too smart for me! Here is the tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic