struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Pearson" <Jon.Pear...@sixnet.com>
Subject RE: OGNL in HTML tags
Date Fri, 01 May 2009 12:18:00 GMT
> > I'm trying to colorize table rows in a JSP based on the result of a 
> > function call into the Action. Here's what I want to do:
> > 
> > <tr class="%{getStatus(deviceID)}">
> > ...
> > </tr>
> > 
> > And have the function "String getStatus(long deviceID) { 
> ... }" look 
> > up the status of a device and return a CSS class name (such as 
> > 'normal', 'warning', or 'error').
> > 
> > But OGNL doesn't execute in non-Struts2 tags... Is there a 
> > straightforward way to do this? At the moment, I'm thinking 
> I need to 
> > implement my own tag library that will add a Struts2-like "tr" tag.
> 
> <tr class="<s:property value="%{getStatus(deviceID)}"/>">
> 
> Dave

Thanks, that worked.

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


Mime
View raw message