开发者

Jetty: To embed or not to embed?

开发者 https://www.devze.com 2022-12-21 14:49 出处:网络
What are the benefits of 开发者_Python百科embedding jetty vs deploying your webapp(s) in jetty? If you are planning on deploying more than one web app, should you strictly stick with deploying a war f

What are the benefits of 开发者_Python百科embedding jetty vs deploying your webapp(s) in jetty? If you are planning on deploying more than one web app, should you strictly stick with deploying a war file for each web app (as opposed to writing an embedded server which calls each web app)?


i'd use jetty embedded when the goal is to create a standalone application in which jetty is just one of the components (for example in an osgi container). if you just want to deploy some war's then a default jetty installation seems more preferable. i don't think the choice depends on whether you plan to deploy more than one webapp. when you embed jetty you'll have to do the plumping yourselves in your code.


Embedding jetty is handy in two cases I'm familiar with:

  1. JNI. It's a lot easier to make sure you've got the right things in the right class loader.

  2. Development. It's much easier to fire up an embedded jetty in eclipse than to dance around with the eclipse web tools and deal with deployments and debugger attaching.


Have a look at the Winstone servlet container which allows you to distribute a single WAR file as an executable jar as a supported use case. This is what Hudson does.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号