[ 
https://issues.apache.org/jira/browse/WICKET-4375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13198667#comment-13198667
 ] 

Martin Grigorov commented on WICKET-4375:
-----------------------------------------

The reason is that now you can read POST parameters in PageParameters: 
https://issues.apache.org/jira/browse/WICKET-4338.

Here is a solution for your need:

@Override
    protected void respond(final AjaxRequestTarget target) {
        HttpServletRequest req = (HttpServletRequest) 
RequestCycle.get().getRequest().getContainerRequest();
        try {
                Request request = RequestCycle.get().getRequest();
                IRequestParameters requestParameters = 
request.getPostParameters();
                for (String paramName : requestParameters.getParameterNames())
                {
                        List<StringValue> parameterValues = 
requestParameters.getParameterValues(paramName);
                        for (StringValue value : parameterValues)
                        {
                                System.err.println(paramName + " -> " + value);
                        }
                }
                BufferedReader in = new BufferedReader(new 
InputStreamReader(req.getInputStream()));
            target.appendJavaScript("alert('" + in.readLine() + "')");
        } catch (IOException ex) {
            Logger.getLogger(AjaxBehavior.class.getName()).log(Level.SEVERE, 
null, ex);
        }
    }
                
> Reading body of the request in AbstractDefaultAjaxBehavior
> ----------------------------------------------------------
>
>                 Key: WICKET-4375
>                 URL: https://issues.apache.org/jira/browse/WICKET-4375
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.4
>            Reporter: Bálint Kriván
>              Labels: ajax, request
>         Attachments: myproject.zip
>
>
> If you want to read the body of the request you will get null from 1.5.4 
> (I've tried 1.5.4 and 1.5-SNAPSHOT). In 1.5.3 it works as expected. I'll 
> upload a quickstart.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to