struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albrecht Leiprecht" <aleipre...@t-online.de>
Subject RE: Conditionally show values in Tile (c:when?)
Date Thu, 11 Aug 2005 13:34:03 GMT
Let me rephrase the question ....

Is there any limitation on using JSTL in Tiles ???

Rgs
albi

-----Original Message-----
From: Albrecht Leiprecht [mailto:aleiprecht@t-online.de] 
Sent: Thursday, August 11, 2005 3:28 PM
To: 'Struts Users Mailing List'
Subject: Conditionally show values in Tile (c:when?)

Hi all,

I have a tile that shows my default input row in a form. In case that I put
a value in FieldError, I want it to show it the errorMessage in red color.
So far so good. The values get to the tile (formRow)... and there it's
getting somewhat tricky. After reading a number of explanations, I
understands that struts.apache.org recommends to use JSTL whenever
possible... thus I use the c:when/c:otherwise construct like follows

<tiles:useAttribute id="errmsg" name="FieldError" scope="page"/>

<td>
  <%=errmsg.toString().length()%> 
  <%--correctly prints the expected value--%>
        
  <c:choose>
    <c:when test="${errmsg.toString().length() > 0}">
	<font color="#FF0000">
	  <tiles:getAsString name="FieldError"/>
	</font>
    </c:when>
    <c:otherwise>
	<img src="/img/blank.gif" height="1" width="111">
  	<%--unexpectedly always shows this--%>
    </c:otherwise>
  </c:choose>
</td>

Substitutes using logic:greaterThat are showing the same strange behavior...
Any Idea why this happens ? Any Tutorials, I could look up ?

TIA,
albi




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


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


Mime
View raw message