• Post Reply Bookmark Topic Watch Topic
  • New Topic

Outputstream to image  RSS feed

 
Vivek Choudhary
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!