tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vernon Wu <vern...@gatewaytech.com>
Subject Re: How to access an element of array without using the iteration tag
Date Wed, 11 Sep 2002 00:50:58 GMT

Thanks Hans for your quick response. 

In fact, I didn't phrase my question right. The data is a path of an image. The expression
doesn't work in the situation. I 
have to use the script as the followings:

	<% if(prov.getPhotoPaths() == null) { %>
		<IMG SRC="<%=request.getContextPath()%>/images/no_photo.gif" NAME="No Photo Available"

ALIGN=BOTTOM BORDER=0>
      	<% } else {  %> 
      		<IMG SRC="<%=(prov.getPhotoPaths())[0]%>" NAME="Photo" ALIGN=BOTTOM BORDER=0>
      	<% } %>

<IMG SRC="${prov.photoPaths[0]}"> doesn't seem to work.




9/10/2002 5:01:53 PM, Hans Bergsten <hans@gefionsoftware.com> wrote:

>Vernon Wu wrote:
>> I need to access the first element of array using JSTL. After a few of trial and
error, I don't success without using the 
>> iteration tag. I don't image that is a difficult one, but just don't know how.
>> 
>> Thanks for your cue.
>
>Use an EL expression like this: ${myArray[0]}
>
>Hans
>-- 
>Hans Bergsten		hans@gefionsoftware.com
>Gefion Software		http://www.gefionsoftware.com
>JavaServer Pages	http://TheJSPBook.com
>
>
>--
>To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>
>
>




--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message