• 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Outputstream to image

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am creating a custom tag which generates the img on jsp.
like this


But in the tag class I amcreating the image using some graphics functions so I have Bufferedimage which I need
to output through this img tag.

Please help me, how can I achieve this.

Thanks
 
Sheriff
Posts: 67759
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
Your <img> tag is empty. Be sure to check "disable html" when posting HTML code.

In any case, the buffered image is useless in the JSP. The <img> tag needs to reference the URL of a servlet that will serve the image data.

Search through this forum for previous discussions. It's been covered dozens of times. Please SearchFirst.
 
Vivek Choudhary
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thnaks, Bibeault

Actuall I am naking a chart taglib which generates the chart(bar or pie).
So in taglib i mcreating the chart as image and now want to display it.

So what is the better way to display this image.

Thanks.
 
Bear Bibeault
Sheriff
Posts: 67759
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
We still have no idea what your taglib is doing. Your first post isn't complete.

The thing to remember is that a JSP is just a template for an HTML page. So when it comes down to it, your JSP must end up generating valid HTML. Binary image data in a JSP/HTML page is not useful. <img> tags that reference URLs that serve the image data as their responses is what is needed.
 
It's feeding time! Give me the food you were going to give to this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic