Hi

The jetty component does not have serving static html files supported
out of the box.

There were some ppl in the community working on that.

But you can use a Camel processor / java bean / message transformation
eip to set the message body to a java.io.File or some input stream to
load a resource from the classpath.



On Fri, Apr 3, 2015 at 3:45 PM, Mon Baroi <baroi...@gmail.com> wrote:
> Hey Guys,
>
> I'm a newbie to Camel and self-taught in Java. I've been scouring the
> internet and I hope you can point me in the right direction.
>
> This is what I am trying to do:
>
> (1) User hits a web service
>
> (2) As a response the web service returns a webpage
>
> I know I have to use HTTP and that the Jetty component is my best bet.
>
> This is my Route class:
>
> *public class MyRoute extends RouteBuilder {*
>
> *@Override*
>
> *public void configure() throws Exception {*
>
> *           from("jetty://http://localhost:8080/ExchangeSendPage
> <http://localhost:8080/ExchangeSendPage>")*
>
> *           //.setHeader("webPageFileName", constant("index.html"))*
>
> *           .process(new myProcessor()); *
>
> *           .to()*
>
> *    }*
>
> *}); *
>
> *}*
>
> This my Processor Class:
>
> *public class myProcessor implements Processor {*
>
> *public void theprocess (Exchange exchange) throw Exception {*
>
> *    return ("ExchangeSendPage.html"); *
>
> *}*
>
> I am completely lost and could use some guidance on the following:
>
>  (1) How do I set up my localhost where when the user is on their own
> machine, they can just click on the .html file? Would I use xpath? Right
> now I don't have the .html file going anywhere. I'm sure its not even
> attached to the local host.
>
> (2) How do I attach my html page to my processor? Or is this even the right
> way to go about doing it?
>
> (3) Should the .to go to the URL of the server that it would be hitting?
> This would be considered an endpoint?
>
> Please let me know if anything is confusing.
>
>
> Thank you so much,
>
> Mon.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to