tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David M. Karr)
Subject Re: How to access an element of array without using the iteration tag
Date Wed, 11 Sep 2002 01:11:09 GMT
>>>>> "Vernon" == Vernon Wu <> writes:

    Vernon> Thanks Hans for your quick response. 

    Vernon> 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 
    Vernon> have to use the script as the followings:

    Vernon> 	<% if(prov.getPhotoPaths() == null) { %>
    Vernon> 		<IMG SRC="<%=request.getContextPath()%>/images/no_photo.gif" NAME="No
Photo Available" 
    Vernon>       	<% } else {  %> 
    Vernon>       		<IMG SRC="<%=(prov.getPhotoPaths())[0]%>" NAME="Photo" ALIGN=BOTTOM
    Vernon>       	<% } %>

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

Then i would guess you actually want this:

  <IMG SRC='<c:out value="${prov.photoPaths[0]}"/>'>

However, this will only work if you created a scoped variable named "prov" from
the "prov" variable.  You don't show that happening here.  Scoped variables are
not the same as scripting variables.  A scoped variable is just a page,
request, session, or application attribute.

David M. Karr          ; Java/J2EE/XML/Unix/C++

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

View raw message