User Tools

Site Tools


java_jetty_server_on_metaarray

This is an old revision of the document!


FIXME this is under construction

Setting up a simple Java Jetty Server

Java web programming includes a servlet architecture for making server applications in java and having the nitty gritty of managing the web server part of the application to a web server that functions as a servlet container. One popular embedded server for Java projects is Jetty.

You can create a java server project that embeds Jetty and run it on the MetaArray on your assigned port. Below is a very simple example on how to get started with that. It doesn't use any IDE, so it's a bit manual. You can find more detailed directions at the external project links below.

There are lots of different java frameworks that center around using the Jetty server, including a few micro frameworks. I am going to show an example using Javalin, which is a microframework that is a lighter load that Spring Boot and other more mainline frameworks. It has a simple tutorial that was used and modified a bit here to show you how to set up a Java Jetty server. To make things quick to set up, we'll use Maven (mvn).

Create Project Space

First, we'll create your maven-style project folder.

  1. Go to an appropriate project folder that you want to work in
  2. make the java source folder in the maven style
    • mkdir -p src/main/java/myproject

Create Project Object Model

Next, we'll set up the POM file, which maven will use to pull all the dependencies for our framework and let us build it.

java_jetty_server_on_metaarray.1642707628.txt.gz · Last modified: 2022/01/20 19:40 by peteyboy