1 5 6 package org.infohazard.maverick.flow; 7 8 import java.util.Map ; 9 import javax.servlet.ServletException ; 10 11 14 public class ControllerWithParams implements Controller 15 { 16 19 protected Controller decorated; 20 23 protected Map params; 24 25 30 public ControllerWithParams(Controller decorate, Map params) 31 { 32 if (params == null) 33 throw new IllegalArgumentException ("Don't use this decorator without params"); 34 35 this.decorated = decorate; 36 this.params = params; 37 } 38 39 44 public String go(ControllerContext cctx) throws ServletException 45 { 46 ((MaverickContext)cctx).putAllControllerParams(this.params); 47 48 return this.decorated.go(cctx); 49 } 50 54 public Controller getDecorated() 55 { 56 return decorated; 57 } 58 } 59 | Popular Tags |