Woo, in this case you need build up form post request before sending it
to servlet.
On 1/7/11 8:39 AM, Kazi, Iftekhar wrote:
The Servlet Exists and when accessed comes up with an html form with a submit
button. However, using the route below lends an error.
<route>
<from uri="direct:start" />
<to uri="xslt:sometransform.xsl"/>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<to uri="http://tlsomnnstst01:8080/servletsample" />
<to uri="http://localhost:8080/myApp/ServletSample" />
-----Original Message-----
From: Willem Jiang [mailto:[email protected]]
Sent: Thursday, January 06, 2011 7:32 PM
To: [email protected]
Subject: Re: Routing to a Servlet
On 1/7/11 8:23 AM, Kazi, Iftekhar wrote:
Is it possible to post a payload to a existing Servlet on another server using
Camel ?
Eg.
<route>
<from uri="direct:start" />
<to uri="xslt:sometransform.xsl"/>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<to uri="http://tlsomnnstst01:8080/servletsample" />
<to uri="http://localhost:8080/myApp/ServletSample" />
Where http://localhost:8080/myApp/ServletSample is an existing Servlet ? Thanks
Absolutely yes.
camel-http component can send the request to the existing servlet.
Please make sure the servlet can be accessed locally.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang