Announcement Announcement Module
Collapse
No announcement yet.
displaytag and AbstractController Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • displaytag and AbstractController

    Hi all,
    I am using displaytag to show a list of objects retreived from the database with a quite slow query. I am using AbstractController with its handleRequestInternal method to retreive the list and put it in the modelmap.

    My problem is that when I use displaytags' paging links, the controller is called again and (obviously) it retreives the full set of data again. How can I handle a 2nd time request and "save" the list so I don't have to query the database again? I need to retreive all the data at once since I use the export options, and I don't know which aproach to give to this problem.

    Should I use another type of controller? I don't see any usefull method to override in AbstractController, and don't think I should use any AbstractFormController either, as it isn't a Form itself.

    Any help will be appreciated, thanks in advance!

  • #2
    I just ignore the list update in the second call using the following code snippet :
    Code:
     Map paramMap = WebUtils.getParametersStartingWith(request, "d-");  
    if (paramMap.size() == 0) {  
                 WebUtils.setSessionAttribute(request, "userList", userList);  
    }
    If you're interested I wrote a small post about it here.

    Comment

    Working...
    X