struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Taylor" <rtay...@mulework.com>
Subject RE: What Is Wrong With This <c:if test=" ..."> Tag?
Date Thu, 01 Jul 2004 20:16:09 GMT
You cannot embed tags as attribute values in other tags.

Assuming you are using Struts-EL tag library AND the container you
are using supports JSTL 1.1, then you can try the following:

<c:if test="${fn:startsWith(attachBean.attachMimeType,'image/')}">
<html_el:img page="getattachment?attach=${attachBean.attachID}}" 
             alt="${attachBean.attachFilename}" 
             title="${attachBean.attachFilename}" 
             border="0"/>
</c:if>


This code is not tested.


robert

> -----Original Message-----
> From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> Sent: Thursday, July 01, 2004 3:50 PM
> To: struts-user@jakarta.apache.org
> Subject: What Is Wrong With This <c:if test=" ..."> Tag?
> 
> 
> It seems that I have problems to get JSTL tags
> right....
> 
> <c:if
> test="${attachBean.attachMimeType.startsWith('image/')}">
>      <html:img page="getattachment?attach=<c:out
> value='${attachBean.attachID}' />" alt="<c:out
> value='${attachBean.attachFilename}' />" title="<c:out
> value='${attachBean.attachFilename}' />" border="0" />
> </c:if>
> 
> error message:
> 
> 74: tag = 'if' / attribute = 'test': An error occurred
> while parsing custom action attribute "test" with
> value
> "${attachBean.attachMimeType.startsWith('image/')}":
> Encountered "(", expected one of ["}", ".", ">", "gt",
> "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=",
> "ne", "[", "+", "-", "*", "/", "div", "%", "mod",
> "and", "&&", "or", "||"] 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail 
> 
> ---------------------------------------------------------------------
> 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