Never set a string array instead of a string HTTP parameter, but
if more than one value is present, additionally set an array parameter with the name paramname_array (i.e. _array appended to the parameter name)..
This commit is contained in:
parent
4cd1f12700
commit
00fe000d78
2 changed files with 8 additions and 6 deletions
|
@ -129,10 +129,11 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
// Params parsen
|
||||
String nextKey = (String)e.nextElement();
|
||||
String[] paramValues = request.getParameterValues(nextKey);
|
||||
if (paramValues != null && paramValues.length == 1)
|
||||
if (paramValues != null) {
|
||||
reqtrans.set (nextKey, paramValues[0]); // set to single string value
|
||||
else if (paramValues != null)
|
||||
reqtrans.set (nextKey, paramValues); // set to string array
|
||||
if (paramValues.length > 1)
|
||||
reqtrans.set (nextKey+"_array", paramValues); // set string array
|
||||
}
|
||||
}
|
||||
|
||||
String contentType = request.getContentType();
|
||||
|
|
|
@ -101,10 +101,11 @@ public class AcmeServletClient extends HttpServlet {
|
|||
// Params parsen
|
||||
String nextKey = (String)e.nextElement();
|
||||
String[] paramValues = request.getParameterValues(nextKey);
|
||||
if (paramValues != null && paramValues.length == 1)
|
||||
if (paramValues != null) {
|
||||
reqtrans.set (nextKey, paramValues[0]); // set to single string value
|
||||
else if (paramValues != null)
|
||||
reqtrans.set (nextKey, paramValues); // set to string array
|
||||
if (paramValues.length > 1)
|
||||
reqtrans.set (nextKey+"_array", paramValues); // set string array
|
||||
}
|
||||
}
|
||||
|
||||
String contentType = request.getContentType();
|
||||
|
|
Loading…
Add table
Reference in a new issue