struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albrecht Leiprecht" <>
Subject RE: Conditionally show values in Tile (c:when?)
Date Thu, 11 Aug 2005 14:16:06 GMT

>>  <%=errmsg.toString().length()%>
>>  <%--correctly prints the expected value--%>

>I believe the scriptlet is evaluated at runtime(server-side). Is it 
>possible you have a bean property holding this: errmsg 'expected value'

Naa... I intentionally used a name I could be sure is not used anywhere else

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

>However the JSTL is explicitly directed to Page-scope for this. See a 

Well, requestscope would be a problem, as soon as I get more than one
instances of the same tile for that request...

>To address your previos question, I believe Tiles does not impose any 
>limitation on your JSTL.

There must be something... I have replaced the c:when/otherwise construct
with a java if/else substitute like that:

	if (errmsg.toString().length() > 1) {
	<font color="#FF0000">
		<tiles:getAsString name="FieldError"/>
	} else {
	<img src="/img/blank.gif" border=1 height="1" width="111">

%> as expected ...

BTW: c:when test="${true}"> doesn't work either (just checked)


-----Original Message-----
From: Albrecht Leiprecht []
Sent: Thursday, August 11, 2005 8:34 AM
To: 'Struts Users Mailing List';
Subject: RE: Conditionally show values in Tile (c:when?)

Let me rephrase the question ....

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


-----Original Message-----
From: Albrecht Leiprecht []
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 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"/>

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

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


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

View raw message