I am using the direct='true' attribute to write the String
'images/example.gif' to the template file. The trouble is that in the
template file, you cannot embed the <template:get> tag within the
<html:img> page attribute.

I think I'm going to end up with lots of tiny jsp pages containing only
image tags!

Thanks ayway,

-James

----- Original Message -----
From: "Aaron Ravenberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'James Maggs'"
<[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 3:37 PM
Subject: RE: Templates & Images


> Using <template:put> tag show below is trying to put an image file as
> include into the JSP.template, then asking the JSP.template to compile.
> What you really want to display is the String '/images/example.gif'.  So
you
> have to specify a my.JSP that contained the text '/images/example.gif',
> therefore you would need to use a html <img src="<template:get>" > or have
> the my.JSP file contain the <html:img> tag.
>
> If you only have a few images that can be displayed and depending on what
> you use to determine to display them, wrapping the <img> tags in
> <logic:present> tags might be a solution.
>
> -Aaron
>
> -----Original Message-----
> From: James Maggs [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 15, 2001 10:00 AM
> To: [EMAIL PROTECTED]
> Subject: Templates & Images
>
>
> Hi There,
>
> I'm working on a Struts powered site right now and have come up against a
> bit of a problem. I'm using the templating tags to give my pages a uniform
> look and feel. However I'd like to be able to insert images into my
> template. I figured the best way would be as follows:
>
> <template:insert template='/template.jsp'>
>   <template:put name='image' content='/images/example.gif' direct='true'
/>
> </template:insert>
>
> But this begs the question, how do you insert the content into the src
> attribute of the image tag? I suppose I could put the whole image tag into
> the template but I'd rather avoid embedding content in the above code.
>
> Can anyone suggest a best way forward?
>
> Many thanks,
>
> -James
>
>

Reply via email to