[ http://issues.apache.org/struts/browse/WW-1331?page=all ]

Don Brown resolved WW-1331.
---------------------------

    Resolution: Fixed

How are you sending this XML through the HTTP POST?  If this is because of a 
ReST or AJAX call, then be sure you are not using the 
"application/x-www-form-urlencoded" content type.  If you don't use this 
content type, then the servlet container and therefore Struts/WebWork won't 
parse the body and you should be able to access it through getInputStream().  
Here is a good post explaining the process: 
http://mail-archives.apache.org/mod_mbox/tomcat-users/200004.mbox/[EMAIL 
PROTECTED]

As you can see, this is a servlet specification issue and not specifically 
WebWork.  Try changing the content type and you should be able to access your 
XML correctly.  Alternatively, you could create your own ActionMapper that 
doesn't call getRequestMap(), although I'm pretty sure that getParameter() is 
at least called in other areas of Struts/WebWork.

> Ability to get an request.getInputStream() data
> -----------------------------------------------
>
>                 Key: WW-1331
>                 URL: http://issues.apache.org/struts/browse/WW-1331
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Dispatch
>    Affects Versions: WW 2.2.1
>         Environment: Windows XP Tomcat 5.5.12
>            Reporter: Vlasov Igor
>
> if we look in  com.opensymphony.webwork.dispatcher.FilterDispatcher on 
> doFilter then find  ActionMapping mapping = mapper.getMapping(request);. That 
> method call :Map parameterMap = request.getParameterMap();
> Thereforeif we want to call  InputStream in = request.getInputStream() in 
> some action class in any method(e.g. execute)
> then we get an EMPTY stream!!!
>  That is too Bad!!!
> To avoid this i must use some izvrashenija(dirty hack):
> write a filter:
> public class RawPostFilter
>     extends HttpServlet implements Filter {
>   public static String RAW_POST = "rawPostData";
>   public void init(FilterConfig filterConfig) throws ServletException {
>   }
>   public void doFilter(ServletRequest request, ServletResponse response,
>                        FilterChain filterChain) throws java.io.IOException,
>       ServletException {
>     InputStream in = request.getInputStream();
>     String origRP = FileUtil.getContent(in, "UTF-8");
>     request.setAttribute(RAW_POST, origRP);
>     //further
>     filterChain.doFilter(request, response);
>   }
> } 
> and inset it upper than WW filter
>    

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to