User Tools

Site Tools


java_jetty_server_on_metaarray

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
java_jetty_server_on_metaarray [2023/04/27 18:26] – [Setting up a simple Java Jetty Server] fix typo, and sentence peteyboyjava_jetty_server_on_metaarray [2024/09/05 04:25] (current) – al” hc9
Line 1: Line 1:
- 
 ====== Setting up a simple Java Jetty Server  ====== ====== 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 [[https://www.eclipse.org/jetty/ |Jetty]]. 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 [[https://www.eclipse.org/jetty/ |Jetty]].
Line 15: Line 13:
   - make the java source folder in the maven style   - make the java source folder in the maven style
     * ''mkdir -p src/main/java/myproject''     * ''mkdir -p src/main/java/myproject''
- 
  
 ===== Create Project Object Model ===== ===== Create Project Object Model =====
Line 21: Line 18:
 Next, let's set up the POM file, which maven will use to pull all the dependencies for our framework and let us build it. Next, let's set up the POM file, which maven will use to pull all the dependencies for our framework and let us build it.
  
-  - Create a new file in "myproject", call it ''pom.xml''+  - Create a new file in myproject, call it ''pom.xml''
     * ''nano pom.xml''     * ''nano pom.xml''
   - Paste in the following: <code>   - Paste in the following: <code>
Line 102: Line 99:
 ===== Add Your Java Code ===== ===== Add Your Java Code =====
  
- - Using an editor again, create your hello world class file, in its proper folder for maven:+  - Using an editor again, create your hello world class file, in its proper folder for maven:
     - ''nano src/main/java/myproject/helloWorld.java''     - ''nano src/main/java/myproject/helloWorld.java''
     - paste in the following: <code java>     - paste in the following: <code java>
Line 134: Line 131:
   [INFO] Finished at: 2022-01-20T21:04:04Z   [INFO] Finished at: 2022-01-20T21:04:04Z
   [INFO] ------------------------------------------------------------------------   [INFO] ------------------------------------------------------------------------
-   +
-  +
 ===== Run Your Server ===== ===== Run Your Server =====
  
-Now, let's run the server. We've set up an "exec goalin the POM so we can run the resulting project from maven, like so:+Now, let's run the server. We've set up an exec goal” in the POM so we can run the resulting project from maven, like so:
  
   mvn exec:java   mvn exec:java
java_jetty_server_on_metaarray.txt · Last modified: 2024/09/05 04:25 by hc9