public ActionForward executeWithErrorHandling ( ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response , ActionErrors errors ) throws Exception { // Get a reference to the session. HttpSession session = request . getSession ( false ) ; // Extract the page form. DynaActionForm pageForm = ( DynaActionForm ) form ; log . fine ( "pageForm = " + pageForm ) ; // Get the paged list object from the session. String listingVarName = pageForm . getString ( VAR_NAME_PARAM ) ; log . fine ( "listingVarName = " + listingVarName ) ; PagedList pagedList = ( PagedList ) session . getAttribute ( listingVarName ) ; // Set its current page. pagedList . setCurrentPage ( ( Integer ) pageForm . get ( NUMBER_PARAM ) ) ; // Set its index offset if one is specified. Integer index = ( Integer ) pageForm . get ( INDEX_PARAM ) ; if ( index != null ) { pagedList . setCurrentIndex ( index ) ; } // Forward to the success location. return mapping . findForward ( SUCCESS_FORWARD ) ; }
Updates the current page or index offset of a paged list in the session scope .