1 19 20 package com.sslexplorer.table.actions; 21 22 import javax.servlet.http.HttpServletRequest ; 23 import javax.servlet.http.HttpServletResponse ; 24 25 import org.apache.struts.action.ActionForm; 26 import org.apache.struts.action.ActionForward; 27 import org.apache.struts.action.ActionMapping; 28 29 import com.sslexplorer.core.actions.AuthenticatedDispatchAction; 30 import com.sslexplorer.policyframework.Permission; 31 import com.sslexplorer.policyframework.ResourceType; 32 import com.sslexplorer.table.forms.AbstractPagerForm; 33 34 40 public abstract class AbstractPagerAction extends AuthenticatedDispatchAction { 41 42 43 46 public AbstractPagerAction() { 47 super(); 48 } 49 50 56 public AbstractPagerAction(ResourceType resourceType, Permission[] permissions) { 57 super(resourceType, permissions); 58 } 59 60 67 public AbstractPagerAction(ResourceType resourceType, Permission[] permissions, ResourceType requiresResources) { 68 super(resourceType, permissions, requiresResources); 69 } 70 71 79 public ActionForward filter(ActionMapping mapping, ActionForm form, HttpServletRequest request, 80 HttpServletResponse response) throws Exception { 81 82 if(mapping.getScope().equalsIgnoreCase("request")) { 83 ((AbstractPagerForm)form).setStartRow(0); 86 return unspecified(mapping, form, request, response); 87 } 88 else { 89 ((AbstractPagerForm)form).getPager().firstPage(); 92 93 ((AbstractPagerForm)form).getPager().rebuild(((AbstractPagerForm)form).getFilterText()); 94 return mapping.findForward("display"); 95 } 96 } 97 98 } 99 | Popular Tags |