Claus Ibsen wrote:
> 
> Its easier to help if you post a snippet of your route.
> I would assume that the parameters is stored in the in message as headers.
> So you should be able to access them using the simple language from the
> xml routing also.
> <simple>in.header.foo</simple>
> 

Actually, it would be great if that were possible, but as far as I can tell,
the http request parameters never get set in the header nor properties of
the jetty exchange.

e.g. if the request is http://localhost:8080/test?x=1, then x is not
accessible via ${in.header.x}, ${in.body}, or ${property.x}.

<route>
   <from uri="jetty:http://localhost:8080/test"; />
   <setBody>
      <simple>&lt;html>&lt;body>${in.header.x}&lt;/body>&lt;/html></simple>
   </setBody>
</route>

Of course, if I replace the <setBody> above to a <process> and create a
Processor Java class that contains the following, then it works, but I'd
like to keep the routes in the Spring xml to the extent possible, since
run-time configuration changes are a major goal:

        public void process(Exchange exchange) throws Exception {
                HttpServletRequest req =
exchange.getIn().getBody(HttpServletRequest.class);
                exchange.getOut(true).setBody("<html><body>" + 
req.getParameter("x") +
"</body></html>");
        }

Please advise if my understanding of how this works is incorrect, or if this
should be a JIRA enhancement for the Jetty component.

Thanks in advance,

Steve
-- 
View this message in context: 
http://www.nabble.com/using-jetty-request-params-in-xml-defined-route-tp19277002s22882p19287503.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to