diff --git a/projects/samskivert/src/java/com/samskivert/velocity/InvocationContext.java b/projects/samskivert/src/java/com/samskivert/velocity/InvocationContext.java index 3ed43e34..07112849 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/InvocationContext.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/InvocationContext.java @@ -1,9 +1,9 @@ // -// $Id: InvocationContext.java,v 1.2 2003/06/28 17:11:54 mdb Exp $ +// $Id: InvocationContext.java,v 1.3 2003/10/11 00:13:17 eric Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne -// +// // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 2.1 of the License, or @@ -20,6 +20,8 @@ package com.samskivert.velocity; +import java.util.Enumeration; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -88,6 +90,19 @@ public class InvocationContext extends VelocityContext put(key, new Boolean(value)); } + /** + * Puts all the parameters in the request into the context. + */ + public void putAllParameters () + { + Enumeration e = _req.getParameterNames(); + + while (e.hasMoreElements()) { + String param = (String)e.nextElement(); + put(param, _req.getParameter(param)); + } + } + protected HttpServletRequest _req; protected HttpServletResponse _rsp; }