1 import javax.servlet.http.HttpServletRequest; 2 import javax.servlet.http.HttpServletResponse; 3 4 import jodd.servlet.ActionFilter; 5 import jodd.servlet.ActionServlet; 6 7 public class FooFilter implements ActionFilter { 8 9 public String onAction(HttpServletRequest request, HttpServletResponse response, ActionServlet action) { 10 System.out.println("::: FILTER BEFORE ::: " + action.getActionPath(request)); 11 String never = action.getActionParameter(request, "never"); 12 if (never != null) { 13 return "never"; 14 } 15 return null; 16 } 17 18 public String onAfterAction(HttpServletRequest request, HttpServletResponse response, ActionServlet action, String actionResult) { 19 System.out.println("::: FILTER AFTER ::: " + actionResult); 20 return null; 21 } 22 23 } 24 | Popular Tags |