Deploy application

Pierre PINON edited this page Jan 10, 2014 · 16 revisions

You can deploy applications in many ways.

For application deployment from Classpath, see Maven Packaging page for more informations about the integration of resources.

Deploy War

From FileSystem

Deploy a War located on File System :

jettyBootstrap.addWarApp("/tmp/myApp.war");

or on a specific Context Path :

jettyBootstrap.addWarApp("/tmp/myApp.war", "/myApp");

From Classpath

Deploy a War located on Classpath :

jettyBootstrap.addWarAppFromClasspath("/myApp.war");

or on a specific Context Path :

jettyBootstrap.addWarAppFromClasspath("/myApp.war", "/myApp");

Deploy Static Resource

From FileSystem

Deploy a Static Resource located on File System :

jettyBootstrap.addStaticResource("/tmp/webapp");

or on a specific Context Path :

jettyBootstrap.addStaticResource("/tmp/webapp", "/myApp");

From Classpath

Deploy a Static Resource located on Classpath :

jettyBootstrap.addStaticResourceFromClasspath("/webapp");

or on a specific Context Path :

jettyBootstrap.addStaticResourceFromClasspath("/webapp", "/myApp");

Deploy Exploded War

From FileSystem

Deploy Application located on File System :

jettyBootstrap.addExplodedWarApp("/tmp/webapp", "webapp/WEB-INF/web.xml");

"webapp/WEB-INF/web.xml" is the default location of web.xml Descriptor. You can just set descriptor parameter to null

jettyBootstrap.addExplodedWarApp("/tmp/webapp", null);

or on a specific Context Path :

jettyBootstrap.addExplodedWarApp("/tmp/webapp", null, "/myApp");

From Classpath

Deploy Application located on Classpath :

jettyBootstrap.addExplodedWarAppFromClasspath("/webapp", null);

or on a specific Context Path :

jettyBootstrap.addExplodedWarAppFromClasspath("/webapp", null, "/myApp");

Deploy Self

Deploy automatically Classpath "/webapp" with web.xml Descriptor "/webapp/WEB-INF/web.xml"

jettyBootstrap.addSelf();

or on a specific Context Path :

jettyBootstrap.addSelf("/myApp");

You can addMyself with static method on JettyBootstrap Class too :

JettyBootstrap.startSelf()

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.