struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <nicolas.del...@cgey.com>
Subject Re: image button question
Date Wed, 24 Apr 2002 10:28:05 GMT
> <html:image src="/images/<%=terrbutton1%>" property="territory1"
> value="terr1"></html:image></TD>


I had same problem with Tomcat 3.3.1.
If you look at hte generated HTML code you see

<input type="image" src="/images/<%=terrbutton1%>" ...

The scriptlet code for src attribute has not been parsed.

So, replace in your JSP the src attribute value with:
<html:image src="<%= \"/images/\" + terrbutton1 %>"  ...
(you must escape your quotes with a backslash (\) so that the attribute
declaration is not broken)

The generated HTML becomes
<input type="image" src="/images/MyImage" ...

I hope it will help you.

PS: I recommend you to use the page attribute, so that your image path will
not depend of the servlet context.


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message