• 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

c:import question

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to import a gif/jpg file that's posted on a website,
similarly to the way HFJSP gets a horse.gif picture. The problem
is it's not the only thing on the web page. I got what looked
like the binary code that corresponds to the picture. Here's what
I typed on my jsp:

<c:import url="http://www.chicagoblackhawks.com/assets/team/mikita_chelios.jpg" />

Is there a way to just get the gif/jpeg without having to import the
WHOLE page?

Thanks,

john
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That technique will actually write the binary data comprising the image into the page - <c:import /> is really supposed to be used for including text data from another page (e.g. foreign page or a local JSP). You are seeing correct behaviour.

I'm not familiar with HFSJ's example, but if you want to include a rendered image a Web page, use HTML's <img src="..." /> tag.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic