Add handy function to slide all the request params into the context.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1259 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
eric
2003-10-11 00:13:17 +00:00
parent b524bf58ed
commit 1275d3d979
@@ -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;
}