HTTP parameters with multiple values are now translated to

an array instead of just setting the first value
This commit is contained in:
hns 2001-08-27 17:37:23 +00:00
parent c6d3edf6ae
commit a0715302ae
2 changed files with 9 additions and 5 deletions

View file

@ -129,8 +129,10 @@ public abstract class AbstractServletClient extends HttpServlet {
// Params parsen
String nextKey = (String)e.nextElement();
String[] paramValues = request.getParameterValues(nextKey);
String nextValue = paramValues[0]; // Only take first value
reqtrans.set (nextKey, nextValue); // generic Header, Parameter
if (paramValues != null && paramValues.length == 1)
reqtrans.set (nextKey, paramValues[0]); // set to single string value
else if (paramValues != null)
reqtrans.set (nextKey, paramValues); // set to string array
}
String contentType = request.getContentType();

View file

@ -101,8 +101,10 @@ public class AcmeServletClient extends HttpServlet {
// Params parsen
String nextKey = (String)e.nextElement();
String[] paramValues = request.getParameterValues(nextKey);
String nextValue = paramValues[0]; // Only take first value
reqtrans.set (nextKey, nextValue); // generic Header, Parameter
if (paramValues != null && paramValues.length == 1)
reqtrans.set (nextKey, paramValues[0]); // set to single string value
else if (paramValues != null)
reqtrans.set (nextKey, paramValues); // set to string array
}
String contentType = request.getContentType();