Jump to: navigation, search

Difference between revisions of "Jetty/Howto/Develop"

< Jetty‎ | Howto
Line 1: Line 1:
 
{{Jetty Howto
 
{{Jetty Howto
| introduction = Jetty Development can roughly be consider in two parts:
+
| introduction = Jetty Development can roughly be consider from two aspects:
# Developing standard web applications that use only standard APIs, but that are deployed in jetty either for development and/or production.  These web applications may use some jetty APIs, but only as normal WEB-INF/lib libraries.
+
# <b>Developing standard web applications</b> that use only standard APIs, but that are deployed in jetty either for development and/or production.  These web applications may use some jetty APIs, but only as normal WEB-INF/lib libraries.
# Developing web applications that use jetty JETTY APIs for either embedded or closely integrated purposes. This style of development needs jetty jars on the class path during development and runtime
+
# Developing against the <b>jetty APIs</b> for either embedded or closely integrated purposes. This style of development needs jetty jars on the class path during development and runtime
}}
+
}}  
== Standard Web Application Development ==
+
 
 +
== Standard Web Application Development ==
 +
 
 +
To develop a standard web application with jetty, typically you need only the servlet.jar on the classpath of your IDE and then some way to run a jetty server just to test the web application as part of a normal development lifecycle:
 +
 
 +
=== Jetty Maven Plugin ===
 +
 
 +
[http://maven.apache.org/ Apache Maven] is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
 +
 
 +
Maven is an ideal tool to build a web application project and such projects can use the [[Jetty/Feature/Jetty Maven Plugin]] to run the web application in development mode.
 +
 
 +
Typically a build tool needs to assemble a web application into a war file, which merges the compiled code, the static content and the deployment descriptor into a zipped file, which can then be deployed in a server.  However, during development, the time taken to assemble a war file can be significant and the resulting bundle can be hard to develop against as source code changes are not immediately reflected. 
 +
 
 +
Once the [[Jetty/Feature/Jetty Maven Plugin]] is configured, a jetty server can be started with the command:<pre>
 +
mvn jetty:run
 +
</pre>
 +
This runs the application directly from its unassembled source components, so that if static content is saved from your IDE's editor, it is immediately visible to the jetty server. If you save a java class, then your IDE will probably compile it on the fly and the plugin will notice the change and redeploy the web application within seconds.
 +
 
 +
=== Ant Jetty Plugin ===
 +
 
 +
 
 +
=== OSGi Plugin ===
 +
 
 +
=== Eclipse Web Tooling ===
 +
 
 +
=== Embedded Main ===
 +
 
 +
 
  
 
== Developing against Jetty APIs ==
 
== Developing against Jetty APIs ==

Revision as of 16:34, 15 February 2010



Introduction

Jetty Development can roughly be consider from two aspects:

  1. Developing standard web applications that use only standard APIs, but that are deployed in jetty either for development and/or production. These web applications may use some jetty APIs, but only as normal WEB-INF/lib libraries.
  2. Developing against the jetty APIs for either embedded or closely integrated purposes. This style of development needs jetty jars on the class path during development and runtime

Standard Web Application Development

To develop a standard web application with jetty, typically you need only the servlet.jar on the classpath of your IDE and then some way to run a jetty server just to test the web application as part of a normal development lifecycle:

Jetty Maven Plugin

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Maven is an ideal tool to build a web application project and such projects can use the Jetty/Feature/Jetty Maven Plugin to run the web application in development mode.

Typically a build tool needs to assemble a web application into a war file, which merges the compiled code, the static content and the deployment descriptor into a zipped file, which can then be deployed in a server. However, during development, the time taken to assemble a war file can be significant and the resulting bundle can be hard to develop against as source code changes are not immediately reflected.

Once the Jetty/Feature/Jetty Maven Plugin is configured, a jetty server can be started with the command:
mvn jetty:run

This runs the application directly from its unassembled source components, so that if static content is saved from your IDE's editor, it is immediately visible to the jetty server. If you save a java class, then your IDE will probably compile it on the fly and the plugin will notice the change and redeploy the web application within seconds.

Ant Jetty Plugin

OSGi Plugin

Eclipse Web Tooling

Embedded Main

Developing against Jetty APIs