struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Cronemeyer <>
Subject Re: Tiles - getting parent attribute?
Date Tue, 11 May 2004 13:42:27 GMT
On Mon, 2004-05-10 at 16:40, John Moore wrote:

IN the meantime I've got around it with what I regard as a kludge, but
I'll be getting back to the point again in a couple of days.

A kludge eh?  Well, I've got one for you.  Perhaps we can compare
kludges to see who has the ugliest one.  I have wanted to do something
similar to what you are talking about, and here is how I did it.

<%@ taglib uri="" prefix="c" %>

<c:set var="actionDescription" scope="page"><tiles:getAsString

<!--The above allowed me to use some logic tags to display options to
the user depending on the value of actionDescription.  

In your case you probably just need to set a session variable equal to
the current page value.-->

I used this devious little tag: <c:set>.  It allows you to store as a
variable the evaluated result of another tag.  For page scoped kludging
this is an ok solution.  However, you can take it too far.  I think the
line should be drawn at session scoping such things in struts. I
remember, with no little embarassment, setting a session variable in my
JSP one day.  That particular day turned into a stinking mess because I
ended up re-doing that piece of my application.  Such JSP tricks might
save lots of redundancy in your Struts-Config and Action Classes, but
they make the general flow of the code more obscure, and I'll take
clarity over compactness any day.


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

View raw message