I am looking for a way to get request form parameters with multiple HTTP parts in a servlet filter without uploading files (for now).
request.getParameterMap () returns empty. I understand that this is due to the fact that the request is multi-part.
I looked at commons.HttpFileUpload, but this seems to be too big for my situation. In this filter, I am only interested in the usual parameters and do not want to process file uploads yet.
Edit: The main problem is that I need to have an intact HttpRequestObject down the filter stack. HttpFileUpload seems to consume part of the request data (perhaps using the data stream object and closing it again.)
This, of course, is not too much, this is the right way and is always better than writing the parser yourself. Apache Commons FileUpload has been developed and maintained for many years and has proven to be reliable in handling multipart / form-data requests. You do not want to reinvent the wheel. If you really want to do this (I do not recommend), read the multipart / form-data specification and start by reading HttpServletRequest#getInputStream()(warning: this is a combination of binary and character data!).
HttpServletRequest#getInputStream()
, Apache Commons FileUpload , , multipart/form-data, , Commons FileUpload ( ) , , , . , .
, .
- Oreilly Servlets , , . MultipartRequest, , , , .
, , CSRF -. JS , , ( , ).
, , . , .
, ( ), , JavaScript GET, .. URL- , , HttpServletRequest.getParameter() ( ).
IE, FF Chrome, , , .
, , .
Commons FileUpload .
, :
JSP/Servlet?
Source: https://habr.com/ru/post/1723093/More articles:Pointer designation in C - cLambda Expressions and Event Subscriptions - c #Поддержка Outlook 2003 и 2007 одновременно с взаимодействием - outlookRemoving a Visual Studio line - visual-studioThe easiest way to collect change history since the last merge in Subversion is svnRemoving multiple records in ASP.NET MVC using jqGrid - asp.net-mvcasynchronous task execution for web application - ajaxhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1723096/issues-with-nvidia-nview-desktop-manager-and-delphi-applications&usg=ALkJrhgZ00p4zhUkcgng2ydMQIY0TZpo0AASP.NET Friendly URLs - asp.netjquery find link rel - jqueryAll Articles