Hi,
      Could it be done with the help of tag libraries? My tag libraries
don't connect with the database directly. So I use DTO's. They contain the
image and data for reports. Isn't there a way to pass my Stringbuffer to a
tag directly?
bye,
Mohan

-----Original Message-----
From: Jin Bal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 6:07 PM
To: Struts Users Mailing List
Subject: Re: Image rendering components


Your action could write the html from your DTO directly to the response,
without the need to forward to a JSP.

this would go along the lines of:
<snip>
  inStream = docLib.getDataStream();
  ByteArrayOutputStream out =new ByteArrayOutputStream();
        byte[] buf = new byte[4096];
  int i = -1;
  while ((i = inStream.read(buf))!=-1){
   out.write(buf,0,i);
  }
  response.setContentType(docLib.getContentType());
        response.setIntHeader("Content-length",docLib.getSize().intValue());

response.setHeader("Content-disposition","attachment;filename="+docLib.getFi
lename());
     ServletOutputStream sout = response.getOutputStream();
  out.writeTo(sout);
  out.flush();
        out.close();
        return null;
</snip>

or something similar where you'd be writing the bytes of html string out.

HTH

Jin

----- Original Message -----
From: "Mohan Radhakrishnan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 12:45 PM
Subject: Image rendering components


> Hi,
>         I have a StringBuffer of HTML that includes a generated image. My
> DTO carries it to the presentation tier. How is usually included in the
JSP
> stream ? Tags ?
> bye,
> Mohan
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to