jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vnik...@ca.ibm.com
Subject Re: array as a parameter
Date Tue, 11 Jun 2002 19:10:57 GMT
Hi Shawn,
Thanks for the response.  I tried your solution(the first one) and get the
following error.
"Fatal Error: missing resource: java.util.PropertyResourceBundle"

I have the PropertyResourceBundle class included in the JSP and the java
file, so I don't know what is wrong.  If you could help me in any way it
would be greatly appreciated.



Shawn Bayern <bayern@essentially.net> on 06/07/2002 05:49:52 PM

Please respond to "Tag Libraries Developers List"

To:   Tag Libraries Developers List <taglibs-dev@jakarta.apache.org>
Subject:  Re: array as a parameter

On Fri, 7 Jun 2002 vnikore@ca.ibm.com wrote:

> Hi,
> I'm trying to develop a tag that accepts an array as parameter.  Does
> anyone know what I need to do to have this work properly and use the
> contents of this
> array.
> For example I would like to create a tag such as the one below.  And then
> the tag will function by doing something such as matching 'home' to
> and 'away' to '604800':
> <mytaglib:list name="myname"  valueProperty="{86400,604800}"
> displayProperty="{'home', 'away' }"/>

You cannot pass a Java array literal to a JSP tag.  You can either use an
rtexprvalue to pass the information to the tag for a pre-defined array, or
use JSTL's expression language (with a JSTL tag) to do the same
thing.  That is, either

  <% Object[] a = { ... } %>
  <mytaglib:list valueProperty="<%= a %>" />


  <c:forEach items="${myArrayFromAScopedVariable}"/>

Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)

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

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

View raw message