1. displaytag (4 messages)

    Hi I am a newbiee trying to implement displayTag tag lib. I have put a List into the session and give it as the name of the table, but it doesnt see it. Do I have to sub-class one of their classes? How does that work if I am producing list from one of my actions? I have it working with simple jstl tags, but not all the nicieties of paging, css, etc. I cant take the time to figure out how to coble together some crude form of paging. Is there a better way? How can I get my List "into" a format that can be iterated by the displayTag. Thank you for any enlightment

    Threaded Messages (4)

  2. Re: displaytag[ Go to top ]

    I believe you need to state the list is in session when you pass it to displaytag
  3. It is very easy ...[ Go to top ]

    Hello, There is no special format. The simple collection only ... Lets say that you have student entity with fields firstName and lastName and you want to display collection of students using display tag table. Example servlet(or action) servicing code: ArrayList students = new ArrayList(); Student student = new Student() student.setFirstName("Velja"); student.setLastName("Radenkovic"); students.add(student); request.setAttribute("students", students); RequestDispatcher dispatcher = request.getRequestDispatcher("students.jsp"); dispatcher.forward(request, response); Comment: request.setAttribute("students", students); puts students collection in request scope. Since you are acctualy forwarding to the page, request scope is still valid. So assigns students collection from request scope to DisplayTag table. For column key attribute is "property" which assigns bean field to column. It also works with session scope .... There is also EL(expresion language) version which gives you more explicit control. Please remember that DisplayTag operates with in-memory collections ... At least that was the case when I was using it. Velja Radenkovic
  4. Put objexts into ArrayList[ Go to top ]

    It's a good idea that you put all objexts into ArrayList. ArrayList Tutorial http://www.developerzone.biz/index.php?option=com_content&task=view&id=151&Itemid=36
  5. requestScope[ Go to top ]

    Try using this: Found at: http://displaytag.homeip.net/displaytag-examples-1.1/example-datasource.jsp