camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Problem Apache Camel with JSP/Tomcat application
Date Thu, 20 Dec 2012 00:48:51 GMT
Hi, as you are just want to pulling the request from google not provide the http service like
servlet://www.google.com (http://www.google.com). you should use the http component instead
of servlet.

Please change the route to  
from("http://www.google.com").xxx


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, December 19, 2012 at 11:15 PM, Meriem wrote:

> Thank you for the reply.
> I added all the dependencies (camel-http.jar,camel-servlet.jar,
> commons-httpclient.jar,commons-logging.jar and commons-management.jar), it
> tell me:* Route: route1 started and consuming from:
> Endpoint[servlet://www.google.com (http://www.google.com)],Total 1 routes, of which 1
is started.*
> but I did not get anything from the body of the result on the console. I
> even tried to write in a file but it did not work. Here is my code:
> from("servlet://www.google.com (http://www.google.com)").process(new Processor() {
> public void process(Exchange e) {
> String body = e.getOut().getBody(String.class);
> System.out.print("bbbb hhh");
> System.out.print(body);
>  
> try {
> PrintWriter ecri = new PrintWriter(new
> FileWriter("C:/output/res.xml"));
> ecri.print(body);
> ecri.flush();
> ecri.close();
> } catch (IOException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
>  
> }
> });
>  
> Did I miss something?
> Thank you very much for your time and your help.
> Best,
> Meriem.
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-Apache-Camel-with-JSP-Tomcat-application-tp5724232p5724377.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message