I know that this question has come up on the list
(http://www.mail-archive.com/struts-user@;jakarta.apache.org/msg33402.html), but I 
didn't see a very good answer for it.

What I want to do is build a template that has an image in it. The URL
for the image needs to be dynamically defined by another page. The
problem is that I can't figure out how to get both the context-sensitive
URL rewriting that the <html:img> tag uses with the attribute access
power of the 'tiles' tags. Any ideas?

Consider this brief (and contrived) example:

<!-- Template component (templateComponent.jsp) -->
<%@ taglib prefix="tiles" uri="/WEB-INF/tiles.tld"%>
<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld"%>
<tiles:get name="header"/>
<html:img page="????"/> <%-- What do I put here? --%>
<!-- End Template component -->


<!-- Client page -->
<%@ taglib prefix="tiles" uri="/WEB-INF/tiles.tld"%>
<html>
<head><title>Hello</title></head>
<body>
<tiles:include template="templateComponent.jsp">
    <tiles:put name="header" value="Welcome!"/>
    <tiles:put name="imageUrl" value="/images/welcome.gif"/>
</tiles:include>
</body>
</html>
<!-- End Client page -->


I saw the follow-up
(http://www.mail-archive.com/struts-user@;jakarta.apache.org/msg33601.html) to the 
original posting suggesting doing something like:

<img src="<template:get name='imageFile'/>" />

The problem is that if I do this I've lost the URL re-writing power that I would 
get with the <html:img> tag. Is there a way that I can compute the context-sensitive
URL in the client page and pass that value as a template attribute?

Thanks in advance!

-- 
Alex Vollmer <[EMAIL PROTECTED]>
Logical


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

Reply via email to