Re: Change request
Stefan Armbruster <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
You're right, getParameter doesn't work on MultipartRequest using the standard classes from javax.servlet. I solved this by createing a HttpFileUploadRequestWrapper that extends HttpServletRequestWrapper. The new wrapper is initialized with a HttpServletRequest. If the request is not multipart, HttpFileUploadRequestWrapper behaves exactly like ist superclass. Otherwise it uses Jakarta Commons Fileupload to parse the request. getParamterNames, getParameter and getParameterValues are overridden so the use FileUploads's methods in case of a multipart request. FormMap uses IMHO only getParameterValues and getParameter for retrieving field contents. By using HttpfileUploadRequestWrapper this work full transparently bith both, multipart or non-multipart request. Stefan