How many milliseconds faster/slower is the tiles solution vs. the custom tag solution? When you use a custom tag, can you perceive a difference in page load time? Until you can answer those questions, stick with what you have. Programmers are notoriously bad at guessing where a performance problem is and you need real data to make a decision.

David






From: "Hue Holleran" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List \(E-mail\)" <[EMAIL PROTECTED]>
Subject: [Tiles] Tiles vs. Custom Tag - anyone have a view?
Date: Wed, 6 Nov 2002 18:01:34 -0000

We've been using tiles extensively in an app and it has been extremely
effective - as one might expect for including "tiles" of information on a
page and consolidating standard layout into templates - however I'm
concerned that we might be going too far in its use... and using it where we
might otherwise have used a custom tag:

For a single img that is used extensively in an app that has
mouseover/out/down behaviour, e.g. (in HTML - lots of code left out
deliberately here):

<img src="/images/navigation/right.gif"
onmouseover="javascript:setImg(this,'/images/right_hot.gif')"
onmousedown="javascript:setImg(this,'/images/right_hot_down.gif')"
onmouseout="javascript:setImg(this,'/images/right.gif')">

This can be much simplified to including a "tile" of just this control:

<tiles:insert template="/tiles-components/controls/imgactive.jsp">
<tiles:put imgName="/images/right" />
</tiles:insert>

The alternative would be a custom tag, e.g:

<sshtml:imgactive imgName="/images/navigation/right" />

Which is obviously much easier to include but so much less flexible -
requiring editing tag handler java code to edit html - and all of the issues
this entails - tiles allows us to edit the html in a nice easy jsp. This is
much more effective for complete chunks of html and has saved huge amounts
of time for large "composite controls" that we have everywhere.

I feel it is neater but am concerned we are introducing too much processing
for just producing the html for the control - does anyone else have a view
on this ... any comments appreciated (even "Stupid Idea" if this is).

(code for the template is included below).

Thanks,

Hue.

/tiles-components/controls/imgactive.jsp
----------------------------------------
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<img src="<tiles:getAsString name='imgName'/>.gif"
onmouseover="javascript:setImg(this,'<tiles:getAsString
name='imgName'/>_hot.gif');"
onmousedown="javascript:setImg(this,'<tiles:getAsString
name='imgName'/>_hot_down.gif')"
onmouseout="javascript:setImg(this,'<tiles:getAsString
name='imgName'/>.gif')">


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

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


--
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