You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sol Ido <so...@robbieone.com> on 2011/12/12 17:51:16 UTC

Best practice to generate complexe HTML

Hello everyone,

I'm starting with Camel and i would like to generate advanced HTML content.
I'm using Jetty as a component and not Servlet inside a container.

Is this solution the best one

from("jetty:url").to("freemarker:template")
// or stringtemplate or Velocity

or is there a way to configure jetty with context where it can find more
standard jsp,jsf,struts, etc

Please let me know about your experience.

Robbie

--
View this message in context: http://camel.465427.n5.nabble.com/Best-practice-to-generate-complexe-HTML-tp5068900p5068900.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Best practice to generate complexe HTML

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you use matchOnUriPrefix=true on the jetty endpoints, then they
match any context path prefix,
 from("jetty://0.0.0.0:80/manager?matchOnUriPrefix=true").to("bean:webappOne");

So if you hit these urls they will be triggered in the route above

http://0.0.0.0:80/manager/foo/bar
http://0.0.0.0:80/manager/foo
http://0.0.0.0:80/manager




On Tue, Dec 13, 2011 at 12:51 PM, Sol Ido <so...@robbieone.com> wrote:
> Thank you Claus
>
> I really like Scala and i have to consider the combinaison of Scalate and
> Jade as a generator since i'm still looking for a complete solution.
>
> My main concern is too avoid to declare to much Jetty entries. If i've to
> open one for each action and controller ...
>
> In this page http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty, i can
> setup and instance of Jetty to a war file, bind a context path to it. So i'd
> like to setup a bean in camel like this
>
> <bean id="webappOne" class="...">
> <bean id="webappMain" class="...">
>
> from("jetty://0.0.0.0:80/manager").to("bean:webappOne");
> from("jetty://0.0.0.0:80/").to("bean:webappMain");
>
> and then each of this bean will manage the url using servlet of others
> technologies
>
> I'm curious to know how you users are dealing with complexe url mapping in
> camel. If i can get this to works then i have to integrate camel INSIDE a
> WebContainer.
>
> Thank you any advices and link you can provide me to explore solutions !
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Best-practice-to-generate-complexe-HTML-tp5068900p5071231.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Best practice to generate complexe HTML

Posted by James Strachan <ja...@fusesource.com>.
On 13 December 2011 11:51, Sol Ido <so...@robbieone.com> wrote:
> Thank you Claus
>
> I really like Scala and i have to consider the combinaison of Scalate and
> Jade as a generator since i'm still looking for a complete solution.

As an aside Scalate supports a few different template languages; the 2
most relevant for HTML generation are Jade for nice DRY HTML
generation (which works really nicely with divs, css, wiki markup,
javascript and coffeescript filters)...
http://scalate.fusesource.org/documentation/jade.html

or SSP which is more like velocity / JSP
http://scalate.fusesource.org/documentation/ssp-reference.html

though its the same Scalate library & API to integrate either of these
2 template languages in a web app and the same camel component too -
just specify the template file in the URI in the camel endpoints
http://scalate.fusesource.org/camel.html

-- 
James
-------
FuseSource
Email: james@fusesource.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration and Messaging

Re: Best practice to generate complexe HTML

Posted by Sol Ido <so...@robbieone.com>.
Thank you Claus

I really like Scala and i have to consider the combinaison of Scalate and
Jade as a generator since i'm still looking for a complete solution.

My main concern is too avoid to declare to much Jetty entries. If i've to
open one for each action and controller ...

In this page http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty, i can
setup and instance of Jetty to a war file, bind a context path to it. So i'd
like to setup a bean in camel like this

<bean id="webappOne" class="...">
<bean id="webappMain" class="...">

from("jetty://0.0.0.0:80/manager").to("bean:webappOne");
from("jetty://0.0.0.0:80/").to("bean:webappMain");

and then each of this bean will manage the url using servlet of others
technologies

I'm curious to know how you users are dealing with complexe url mapping in
camel. If i can get this to works then i have to integrate camel INSIDE a
WebContainer.

Thank you any advices and link you can provide me to explore solutions !




--
View this message in context: http://camel.465427.n5.nabble.com/Best-practice-to-generate-complexe-HTML-tp5068900p5071231.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Best practice to generate complexe HTML

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There is no best solution to rule them all.
Use what works best for you.

Yes template engines is great for generating dynamic HTML pages.

If you are into the Scala world, then there is also scalate
http://scalate.fusesource.org/


On Mon, Dec 12, 2011 at 5:51 PM, Sol Ido <so...@robbieone.com> wrote:
> Hello everyone,
>
> I'm starting with Camel and i would like to generate advanced HTML content.
> I'm using Jetty as a component and not Servlet inside a container.
>
> Is this solution the best one
>
> from("jetty:url").to("freemarker:template")
> // or stringtemplate or Velocity
>
> or is there a way to configure jetty with context where it can find more
> standard jsp,jsf,struts, etc
>
> Please let me know about your experience.
>
> Robbie
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Best-practice-to-generate-complexe-HTML-tp5068900p5068900.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/