diff --git a/src/fr/devinsy/kiss4web/ServletTools.java b/src/fr/devinsy/kiss4web/ServletTools.java new file mode 100644 index 0000000..1f75f92 --- /dev/null +++ b/src/fr/devinsy/kiss4web/ServletTools.java @@ -0,0 +1,49 @@ +package fr.devinsy.kiss4web; + +import java.util.Enumeration; + +import javax.servlet.http.HttpServletRequest; + +import fr.devinsy.util.StringList; + +/** + * + */ +public class ServletTools +{ + /** + * + * @param request + * @return + */ + public static String showParameters(final HttpServletRequest request) + { + String result; + + // + StringList buffer = new StringList(); + + // + boolean ended = false; + Enumeration names = request.getParameterNames(); + buffer.appendln("Parameter list:"); + while (!ended) + { + if (names.hasMoreElements()) + { + String name = names.nextElement(); + buffer.append("[").append(name).append("]=[").append(request.getParameter(name)).appendln("]"); + } + else + { + ended = true; + } + } + + // + result = buffer.toString(); + + // + return result; + } +} \ No newline at end of file