Hi, I need some helps from you guys and Spring team experts.
Currently I am doing a serious project. There is one page involves PagedListHolder class and MultiActionCotroller. So this page can display multipage with page number and sort the item easily. Actually I did my project based on the Spring demo -- PagedList (Please see the demo in Spring release 0.9).
Everything is working fine. Here is part of my MultiActionController code:
Because our project strongly discourages the usage of session. So I try to change this by avoid put listHolder into session. What I did was simply commented out:Code:public ModelAndView showInventoryMain(HttpServletRequest request, HttpServletResponse response) throws ServletException { RefreshablePagedListHolder listHolder = (RefreshablePagedListHolder) request.getSession(true).getAttribute(INVENTORY_ATTR); if (listHolder == null) { listHolder = new RefreshablePagedListHolder(); listHolder.setSourceProvider(new InventoryListProvider()); listHolder.setFilter(new InventoryListFilter()); request.getSession(true).setAttribute(INVENTORY_ATTR, listHolder); } BindException ex = BindUtils.bind(request, listHolder, "inventoryList"); listHolder.setLocale(RequestContextUtils.getLocale(request)); boolean forceRefresh = request.getParameter("forceRefresh") != null; listHolder.refresh(forceRefresh);
RefreshablePagedListHolder listHolder = (RefreshablePagedListHolder) request.getSession(true).getAttribute(INVENTORY_AT TR);
and
request.getSession(true).setAttribute(INVENTORY_AT TR, listHolder);
But it doesn't work 100% right. One big problem is that the page only displays the first page (even you click other page number). There are also other problems.
My question is:
If it is possible in Spring to use PagedListHolder without set the instance into session? Can we use request instead? How?
If you know the Spring PagedList demo in version 0.9, you may understand better what I mean.
Any advice will be appreciated. Thank you!


Reply With Quote
