struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: urgent RowsetDynaClass help
Date Tue, 28 Jan 2003 20:51:40 GMT


On Tue, 28 Jan 2003, usha wrote:

> Date: Tue, 28 Jan 2003 16:26:11 +0800
> From: usha <usha@justcommodity.com>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> Subject: Re: urgent RowsetDynaClass help
>
> Hi Craig
>
> i have requirement like this i have rowsetdynaclass from which i am
> displaying the data on the jsp using the iterate tag. can i get the
> values from the dynabeans with jsp scriplet and just out put to the
> jboss console.
> is this possible.
>
> <logic:iterate id="ivtranshdrlist" name="ivtranshdrbean"
> property="batchidlist" scope="request"
> type="org.apache.commons.beanutils.DynaBean">
>     <tr>
>       <td>
>         <%System.out.println("batchid is :" +
> ivtranshdrlist.getIvtransbatchid())%>
>         <bean:write name="ivtranshdrlist" property="ivtransbatchid"
> filter="true"/>
>         </a>
>       </td>
>     </tr>
>   </logic:iterate>
>

You can use a scriptlet if you want to, as long as you use the DynaBean
syntax to get the property out, if you really want to:

  <%
    System.out.println("batchid is :" +
                       ivtranshdrlist.get("ivtransbatchid");
  %>

or use PropertyUtils so that you don't care whether it is a DynaBean or
not:

  <%
    try {
      System.out.println("batchid is :" +
             PropertyUtils.getProperty(ivtranshdrlist, "ivtransbatchid");
    } catch (Exception e) {
      ;
    }
  %>

In a JSP page, of course, you could use <bean:write>:

  batchid is :<bean:write name="ivtranshdrlist"
                      property="ivtransbatchid"/>

This works with either DynaBeans or standard JavaBeans.

> Thanks
> usha
>

Craig



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


Mime
View raw message