You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Akram <ak...@gmail.com> on 2015/08/12 23:03:41 UTC
camel exchange body with html, css and javascript
I am setting the exchange body with set of html lines. But when i execute the
program, it is showing only static html but not the javascript and css..
Here is my sample code
String htmlString= "<html><head><link rel=\"stylesheet\" type=\"text/css\"
href=\"js/timeline.css\"></head><body> Hello world </body></html>";
exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "text/html ;
charset=ISO-8859-1");
exchange.getOut().setBody(htmlString);
I am not getting the page with css enabled. If i run the same html code in
browser directly, i am getting html page with css enabled..
--
View this message in context: http://camel.465427.n5.nabble.com/camel-exchange-body-with-html-css-and-javascript-tp5770632.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel exchange body with html, css and javascript
Posted by Greg Autric <ga...@redhat.com>.
Hi Akram,
could you please send us your full camel route code (please simplify it) ?
FYI, if the content (HTML) changed from camel route to your browser (check HTML source code downloaded CTRL+U for firefox), it could be an issue.
else where are css or js file into camel too ? you should create a webapp to store static resources because create a camel route to provides static resources could be painful and useless.
<html><head><link rel=\"stylesheet\" type=\"text/css\"
href="http://example.org/webapp/js/timeline.css"></head><body> Hello world </body></html>
see u
Greg AUTRIC
JBoss Middleware Consultant
email : gautric __at__ redhat __dot__ com
twitter : @gautric_io
Red Hat Global Services
Red Hat France SARL sit: http://www.redhat.fr
Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
Sent from webmail
----- Mail original -----
De: "Akram" <ak...@gmail.com>
À: users@camel.apache.org
Envoyé: Mercredi 12 Août 2015 23:03:41
Objet: camel exchange body with html, css and javascript
I am setting the exchange body with set of html lines. But when i execute the
program, it is showing only static html but not the javascript and css..
Here is my sample code
String htmlString= "<html><head><link rel=\"stylesheet\" type=\"text/css\"
href=\"js/timeline.css\"></head><body> Hello world </body></html>";
exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "text/html ;
charset=ISO-8859-1");
exchange.getOut().setBody(htmlString);
I am not getting the page with css enabled. If i run the same html code in
browser directly, i am getting html page with css enabled..
--
View this message in context: http://camel.465427.n5.nabble.com/camel-exchange-body-with-html-css-and-javascript-tp5770632.html
Sent from the Camel - Users mailing list archive at Nabble.com.