struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dariusz Wojtas <>
Subject Re[2]: Composite jsp files
Date Wed, 28 Aug 2002 16:20:20 GMT
Maybe I misunderstood you, but ...
Why can't you use the <img> tag?
Image file isnot send in the same response that the jsp/html
file is sent. Browser makes another call for the image
after parsing the html code.

Why don't you just print:
    <img src='/myImgServlet?imgId=<%= imgId %>'>
And it works perfectly with the <logic> tags mentioned below.
There is also no need to change the response type in the middle of
writing to your output stream, because it is completely different call.
You just set it once.
And it will be served by separate servlet (here '/myImgServlet').

Dariusz Wojtas

Wednesday, August 28, 2002, 5:44:40 PM, you wrote:
LW> Thanks John &  Cliff (prior answer).

LW> But john, unfortunately I can't use the img
LW> src tag since the images are directly retrieved
LW> from a database. It doesn't make sense to
LW> first (temporarily) store the images and then
LW> use the img source tag. Instead, I directly
LW> print the images by using the
LW> response.getOutputStream (or something similar)
LW> and setting the contentType + writing the bytes.

LW> Cliff helped me out by showing me the <include>
LW> tags, which i think can be very usefull.

LW> If this does not work, you will hear me scream ;)

LW> Regards,

LW> Leonard

LW> ----- Original Message -----
LW> From: "John Raley" <>
LW> To: "Struts Users Mailing List" <>
LW> Sent: Wednesday, August 28, 2002 4:23 PM
LW> Subject: Re: Composite jsp files

>> With Struts logic:equal tag:
>> <logic:equal ...><img src="..."></logic:equal>
>> Check the doc for the various logic:equal options.
>> Leonard Wolters wrote:
>> >Is it possible to concatenate jsp files to one ?
>> >
>> >The problem i have now is that tomcat / catalina
>> >is complaining when I write multiple times to
>> >the outputstream. A nice: java.lang.IllegalStateException:
>> >getOutputStream() has already been called for this response
>> >is shown to me.
>> >
>> >
>> >My question is if anyone know how to concat jsp files,
>> >or to dymanically create jsp.
>> >
>> >
>> >The problem is as follows: I have a certain jsp file which
>> >may / may not show an image. Based on a particular
>> >(custom made) tag an image should be shown or not.
>> >In both cases, the rest of the page should remain the
>> >same.
>> >
>> >Does anyone has tips / suggestions how to do this ????
>> >
>> >T.i.a.
>> >
>> >Leonard
>> >
>> >
>> --
>> Check it out: Map -> JavaBean
>> --
>> To unsubscribe, e-mail:
LW> <>
>> For additional commands, e-mail:
LW> <>

LW> --
LW> To unsubscribe, e-mail:   <>
LW> For additional commands, e-mail: <>

Best regards,
 Dariusz Wojtas

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message