aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa
diff options
context:
space:
mode:
authorpeter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2005-09-07 14:29:25 +0000
committerpeter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2005-09-07 14:29:25 +0000
commit7317c03005cec9c99e3f4ed8b5497f0050a42a77 (patch)
tree6a3ae63cf6fdb694382bd50a934035d3b1269097 /id.server/src/at/gv/egovernment/moa
parent5745fef76ec99a43701b101937f07cb611cd9d08 (diff)
downloadmoa-id-spss-7317c03005cec9c99e3f4ed8b5497f0050a42a77.tar.gz
moa-id-spss-7317c03005cec9c99e3f4ed8b5497f0050a42a77.tar.bz2
moa-id-spss-7317c03005cec9c99e3f4ed8b5497f0050a42a77.zip
WebDAV Enhancement des Proxy
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@500 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java43
1 files changed, 36 insertions, 7 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java b/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java
index 78d0a0db0..18fc0587e 100644
--- a/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java
+++ b/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java
@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequestWrapper;
+import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.URLDecoder;
/**
@@ -91,7 +92,7 @@ public class InOrderServletRequestWrapper extends HttpServletRequestWrapper {
//Insert code for Query string parsing
String rawQuery = req.getQueryString();
- queryParameters = tokenize(queryParameters, queryParamOrder, rawQuery, DEFAULT_CHARACTER_ENCODING);
+ queryParameters = tokenize(queryParameters, queryParamOrder, rawQuery, DEFAULT_CHARACTER_ENCODING, true);
//analyze HTTP Post body parameters
if (req.getMethod().equalsIgnoreCase("POST"))
@@ -171,7 +172,7 @@ public class InOrderServletRequestWrapper extends HttpServletRequestWrapper {
}
postedBody = new String(postedBytes);
- Hashtable ht2 = tokenize(ht, bodyParamOrder, postedBody, encoding);
+ Hashtable ht2 = tokenize(ht, bodyParamOrder, postedBody, encoding, false);
return ht2;
}
@@ -186,7 +187,7 @@ public class InOrderServletRequestWrapper extends HttpServletRequestWrapper {
*
* @return the Hashtable with the parsed data
*/
- private Hashtable tokenize(Hashtable ht, Vector order, final String parameterString, final String encoding)
+ private Hashtable tokenize(Hashtable ht, Vector order, final String parameterString, final String encoding, boolean decode)
{
String[] valArray = null;
@@ -207,8 +208,15 @@ public class InOrderServletRequestWrapper extends HttpServletRequestWrapper {
}
try
{
- key = URLDecoder.decode(pair.substring(0, pos), encoding);
- val = URLDecoder.decode(pair.substring(pos + 1, pair.length()), encoding);
+ if (decode) {
+ key = URLDecoder.decode(pair.substring(0, pos), encoding);
+ val = URLDecoder.decode(pair.substring(pos + 1, pair.length()), encoding);
+ } else {
+ key = pair.substring(0, pos);
+ val = pair.substring(pos + 1, pair.length());
+ }
+ //Logger.debug("(" + Integer.toString(key.length()) + "=" + Integer.toString(pair.substring(0, pos).length()) + ")"+key+"|--|"+pair.substring(0, pos));
+ //Logger.debug("(" + Integer.toString(val.length()) + "=" + Integer.toString(pair.substring(pos + 1, pair.length()).length()) + ")"+val+"|--|"+pair.substring(pos + 1, pair.length()));
}
catch (Exception e)
{
@@ -324,11 +332,32 @@ public class InOrderServletRequestWrapper extends HttpServletRequestWrapper {
/**
*
* Returns an <code>Enumeration</code> of <code>String</code> objects containing the names of the
+ * parameters. If there are no parameters, the method returns an empty
+ * <code>Enumeration</code>.
+ *
+ * @return an <code>Enumeration</code> of <code>String</code> objects, each <code>String</code>
+ * containing the name of a request parameter; or an empty <code>Enumeration</code> if the
+ * request has no parameters
+ *
+ */
+ public final Enumeration getParameterNames()
+ {
+ Vector FullParamOrder = new Vector();
+ for (Enumeration enu = queryParamOrder.elements(); enu.hasMoreElements();) {
+ FullParamOrder.addElement(enu.nextElement());
+ }
+ for (Enumeration enu = bodyParamOrder.elements(); enu.hasMoreElements();) {
+ FullParamOrder.addElement(enu.nextElement());
+ }
+ return FullParamOrder.elements();
+ }
+
+ /**
+ *
+ * Returns an <code>Enumeration</code> of <code>String</code> objects containing the names of the
* parameters contained in this request. If the request has no parameters, the method returns an empty
* <code>Enumeration</code>.
* @param parameterType type of parameter
- * @see at.gv.egovernment.moa.id.util.ParametersInOrderServlet#QUERY_PARAM
- * and @see at.gv.egovernment.moa.id.util.ParametersInOrderServlet#BODY_PARAM
*
* @return an <code>Enumeration</code> of <code>String</code> objects, each <code>String</code>
* containing the name of a request parameter; or an empty <code>Enumeration</code> if the