camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andres (JIRA)" <>
Subject [jira] Created: (CAMEL-1760) Unable to read post params from request
Date Thu, 25 Jun 2009 12:46:35 GMT
Unable to read post params from request

                 Key: CAMEL-1760
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-jetty
    Affects Versions: 1.6.0
            Reporter: Andres

If consuming messsages from jetty endpoint there is now way to read *post* parameters from

In example  getting HttpServletRequest  from body :
HttpServletRequest req = exchange.getIn().getBody(HttpServletRequest.class);

req.getParameterMap() returns allways empty map

The problem is that jetty Request.extractParameters() method is trying  to read post parameters
from Request.getInputStream().  But unfortunately someone strips the input stream before and
req.getInputStream() returns allways 0 bytes

The workaround for me is to extend DefaultHttpBinding as described in:

{code:title= MyHttpBinding .java|borderStyle=solid}
public class MyHttpBinding extends DefaultHttpBinding {
    public void readRequest(HttpServletRequest request, HttpMessage message) {
calling  request.getParameterMap()  will cache parameters inside jetty Request and it's possible
to query params later,  without having inputStream

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message