You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hari Saptoadi <ha...@indonesian-aerospace.com> on 2004/06/17 11:06:41 UTC

Integrating displaytag with struts

Hi all.....
i want to use displaytag for replace logis:iterate tag
is it "name"  in display:table  tag have same function  with "property" in logic:iterate ?
if not, how can i set data that i want to display in my jsp ? 

Re: Integrating displaytag with struts

Posted by Hari Saptoadi <ha...@indonesian-aerospace.com>.
thank you for your reply Ron........
.i did like this in my action class

Connection con=ko.getCon();
      PreparedStatement prep=con.prepareStatement("select C_KTR,I_KTR,N_KTR
from tmkantor");
      ResultSet rs=prep.executeQuery();
      Vector dt=new Vector();
      while(rs.next())
      {
        Data dat=new Data();
        dat.setKode(rs.getString(1));
        dat.setNomor(rs.getString(2));
        dat.setNama(rs.getString(3));
        System.out.println(" data = "+dat.getKode());
        dt.add(dat);
      }
             request.getSession().setAttribute("dt",dt);

and this is piece of my jsp code

 <html:form action="DpAction">
<display:table name="${dt}" />
<display:column property="kode"></display:column>
<display:column property="nomor"></display:column>
<display:column property="nama"></display:column>
</display:table>
</html:form>

this is what i got when i run it.
      Kode Nomor Nama
      Nothing found to display.

is there anything wrong with my code ?

----- Original Message -----
From: "Ron Grabowski" <ro...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Friday, June 18, 2004 11:46 AM
Subject: Re: Integrating displaytag with struts


> --- Hari Saptoadi <ha...@indonesian-aerospace.com> wrote:
> > Hi all.....
> > i want to use displaytag for replace logis:iterate tag
> > is it "name"  in display:table  tag have same function  with
> > "property" in logic:iterate ?
> > if not, how can i set data that i want to display in my jsp ?
> >
>
> The front page of their website says:
>
> http://displaytag.sourceforge.net/
> "
> <display:table name="${requestScope.object.property}">
> "
>
> Here is a link to their PDF manual:
>
>  http://displaytag.sourceforge.net/displaytag.pdf
>
> Another example would be:
>
>  // in your Action class
>  List productList = generateProductList();
>  request.setAttribute("productList",productList);
>
>  <!-- on your JSP page -->
>  <display:table name="${productList}" />
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


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


Re: Integrating displaytag with struts

Posted by Ron Grabowski <ro...@yahoo.com>.
--- Hari Saptoadi <ha...@indonesian-aerospace.com> wrote:
> Hi all.....
> i want to use displaytag for replace logis:iterate tag
> is it "name"  in display:table  tag have same function  with
> "property" in logic:iterate ?
> if not, how can i set data that i want to display in my jsp ? 
>

The front page of their website says:

http://displaytag.sourceforge.net/
"
<display:table name="${requestScope.object.property}">
"

Here is a link to their PDF manual:

 http://displaytag.sourceforge.net/displaytag.pdf

Another example would be:

 // in your Action class
 List productList = generateProductList();
 request.setAttribute("productList",productList);

 <!-- on your JSP page -->
 <display:table name="${productList}" />

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


RE: Integrating displaytag with struts

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Hari,

i have an action.clazz that "loads" a collection
and adds the coll to request under key "myCollection"
after that it forwards to a jsp

here is my *simple* jsp.file

<%@ taglib uri="/WEB-INF/displaytag-12.tld" prefix="display" %>


<display:table name="myCollection" defaultsort="1"
requestURI="strutsActuinThatLoadsData.do">
  <display:column property="foo" sortable="true"/>
  <display:column property="bar" sortable="true"/>
  <display:column property="yetAnOtherPropertyOfTheBeanInMyCollection"
sortable="true"/>
</display:table>

note, you are now albe (with requestURI) to store the jsp-files
under WEB-INF

Hope that helps you

> -----Original Message-----
> From: Hari Saptoadi [mailto:hari_s@indonesian-aerospace.com] 
> Sent: Thursday, June 17, 2004 11:07 AM
> To: Struts Users Mailing List
> Subject: Integrating displaytag with struts
> 
> 
> Hi all.....
> i want to use displaytag for replace logis:iterate tag
> is it "name"  in display:table  tag have same function  with 
> "property" in logic:iterate ? if not, how can i set data that 
> i want to display in my jsp ? 
> 


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