Jetty: embed or not embed?

What are the benefits of embedding jetty vs deploying your webapp in a jetty? If you plan to deploy more than one web application, should you strictly adhere to deploying a war file for each web application (as opposed to writing an embedded server that calls each web application)?

+48
java web-applications jetty embedded-jetty
Mar 03
source share
3 answers

I would use a pier built in when the goal is to create a standalone application in which the pier is just one of the components (for example, in the osgi container). if you just want to launch some kind of war, then the default setting for the berths seems more preferable. I don’t think that the choice depends on whether you plan to deploy more than one web application. when you embed a berth, you will have to do an overflow of yourself in your code.

+22
Mar 03
source share

Building a berth is convenient in two cases that I am familiar with:

  • Jni

    . It's much easier to make sure you have the right things in the right classloader.

  • Development. It is much easier to run the built-in pier in an eclipse than to dance using eclipse web tools and deal with deployments and a debugger.

+17
Mar 03
source share

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.

+9
Apr 08 2018-10-12T00:
source share



All Articles