I'm trying to use the <link> inside <enumerate> as follows,

<struts:enumerate id="org" name="companies">
          <struts:link href="org.do?action=view" name="org"
property="primaryKey">
          <struts:htmlProperty name="org" property="name"/>
          </struts:link>
        ....
          <struts:htmlProperty name="org" property="contact"/>
</struts:enumerate>

the <link> can't get property for 'primaryKey' when 'companies' is an Array
but works fine is 'companies' is an Enumeration. <htmlProperty> works well
in both cases. 

Any work arround is appreciated.

Thanks.
Kevin

-----Original Message-----
From: Pierre Delisle [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 7:08 PM
To: [EMAIL PROTECTED]
Subject: Re: getting arrays w/ useBean?


Seth,

Simply add the scope attribute and it should then work.

 <jsp:useBean id="id" class="my.class[]" scope="request"/>

     -- Pierre

Seth Ladd wrote:
> 
> Hello,
> 
> I'm having a problem with referencing an array with <jsp:useBean>.  I keep
> getting ClassCastExceptions, and I'm not sure how exactly to do this.
> 
> I gave the request an array of objects using request.setAttribute("id",
> myArray).  When I reference this in my JSP page, I am trying to use
> something like:
> 
> <jsp:useBean id="id" class="my.class[]">
> 
> but it doesn't work.  I have also tried different permutations of class
and
> type using brackets or not.  The goal is to get an array, from the request
> object to the <struts:iterate> taglib (which is really cool, btw!).
> 
> If anyone can help me out, I would really appreciate it.
> 
> Thanks very much in advance,
> Seth
> 
> ps I eventually just didn't use <jsp:useBean> and referenced the array
> directly with iterate, but now I'm really curious how to do it. :)

Reply via email to