You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/09/13 05:13:32 UTC

[jira] Reopened: (WW-1331) Ability to get an request.getInputStream() data

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

Don Brown reopened WW-1331:
---------------------------

             

> 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