i have a webapp (http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download) wich use jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future i would like make more of this kind of weapps.
Now i am looking for a way to deliver this webapps with jetty via jnlp. The end user should be have a zero installation but the webapps needs servlet container and my hoster does not support a servlet container or application server or so on.
I don't like an embedded solution because in this case each webapp must be delivered with a separate jetty und run with a separate jetty -> too big size -> to many download size and so on.
The architecture should be similar to this:
(source: sourceforge.net)
Example: Bundle1 could contains jetty and deployed webapp1 and Bundle2 could contains jetty and deployed webapp1 and webapp2 (related to requirements of end user i would like deliver many variant of my webapps)
But what is my question? 1) Wich jars of jetty are needed? I would like these upload to my homepage for hosting. 2) Wich jar should i use for jetty as main jar to start him via jnlp? 3) Wich main class should i use to start jetty via jnlp? 4) Wich parameter i could use to configure jetty to say this is war of webapp1 and this is war of webapp2.... or this is directory of weapps for hot deployment...?
The important question for me is 1) If this is answered so i could run jetty local (without maven plugin) and via manual maybe i could solve the rest 2-4.
Thanks for ideas
Thomas
Why not deploy a normal Java app (with a main()
etc.) that invokes Jetty programatically via its Server class? That class is configured via code with the appropriate contexts, servlet classes etc.
I've done that before with success. The only headache is running one Jetty with multiple apps being downloaded on request (if I read your question correctly). Can you use some classloading magic, and load classes/apps on demand from a remote URL ?
I have found another way today. This is interesting too. Here is the concept:
- Use java webstart to install an osgi container
- Use a bundle x or a osgi service to download all bundles of your app
- Use the jetty bundle to provide jetty support
Then the application is installed
I got the idea from this article: http://www.toedter.com/blog/?p=45
来源:https://stackoverflow.com/questions/2350749/how-can-i-deliver-jetty-with-many-webapps-via-jnlp