1 16 package org.getahead.dwrdemo.filter; 17 18 import java.lang.reflect.Method ; 19 20 import org.directwebremoting.AjaxFilter; 21 import org.directwebremoting.AjaxFilterChain; 22 23 24 30 public class RandomSecurityAjaxFilter implements AjaxFilter 31 { 32 35 public Object doFilter(Object obj, Method method, Object [] params, AjaxFilterChain chain) throws Exception  36 { 37 if (System.currentTimeMillis() % 2 == 1) 38 { 39 return chain.doFilter(obj, method, params); 40 } 41 else 42 { 43 throw new SecurityException ("Wrong time. Try again later"); 44 } 45 } 46 } 47 | Popular Tags |