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
I believe you need to state the list is in session when you pass it to displaytag
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()
RequestDispatcher dispatcher = request.getRequestDispatcher("students.jsp");
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.