Project

General

Profile

Sample-hello-world » History » Revision 5

Revision 4 (Henning Blohm, 28.02.2021 11:22) → Revision 5/19 (Henning Blohm, 28.02.2021 13:38)

h1. Hello World Web App Sample 

 TBC 

 This sample application shows how to set up the most basic Java Web application in z2.  

 Z2 integrates with the Jetty Web container and Web applications on Z2 are really just standard Java EE Web applications. What is unfamiliar for the typical Maven, Gradle, or Ant user is how applications are developed and modularized on Z2. So this sample case is hence more about Web applications as developed on Z2 than it is about Web application development. 

 Please skip to [[#Step by Step - Or Setting Things Up Yourself|Step by Step - Or Setting Things Up Yourself]] unless you just want to see it running. 

 This sample is stored in the repository "z2-samples-hello-world-web":https://redmine.z2-environment.net/projects/z2-samples/repository/z2-samples-hello-world-web. 

 h2. Prerequisites 

 {{include(Java_Version_Requirements)}} 

 h2. Setting up the sample 

 Follow these instructions, if you just want to see it running. Otherwise we recommend skipping this section and rather follow the step by step instructions below. 

 Here's the really fast version: 

 {{include(Install_sample_prefix)}} 

 <pre><code> 
 git clone -b v2.8 https://www.z2-environment.net/git/z2-samples-hello-world-web 
 </code></pre> 

 {{include(Install_sample_postfix)}} 

 The first time you launch the sample, it will take a while to download all required resources. 

 h2. Step by Step - Or Setting Things Up Yourself 


 In this section we will manually create the basic structure of a Z2 module and see how it is discovered by Z2 during development. 

 We assume that you have prepared some development workspace install and that you installed z2-base.core, the core runtime of z2 in that folder. If you have not done so yet, run 

 {{include(Install_sample_prefix)}} 

 h3. Create a Module 

 Change into install and create a folder z2-samples-hello-world-web and in that folder create the following structure 

 In this section we will manually create the basic structure of a Z2 module and see how it is discovered by Z2 during development. 

 We assume that you have prepared some development workspace install and that you installed z2-base.core, the core runtime of z2 in that folder. If you have not done so yet, run 

 {{include(Install_sample_prefix)}} 

 h3. Create a Module 

 Change into install and create a folder z2-samples-hello-world-web and in that folder create the following structure 

 In this section we will manually create the basic structure of a Z2 module and see how it is discovered by Z2 during development. 

 We assume that you have prepared some development workspace install and that you installed z2-base.core, the core runtime of z2 in that folder. If you have not done so yet, run 

 {{include(Install_sample_prefix)}} 

 h3. Create a Module 

 Change into install and create a folder z2-samples-hello-world-web and in that folder create the following structure 

 <pre> 
 ├── java 
 │   ├── src.api 
 │   ├── src.impl 
 │   └── z.properties 
 └── web 
     ├── WebContent 
     │   └── WEB-INF 
     │         └── web.xml 
     └── z.properties 
 </pre> 

 *Note:* If you are using the Eclipse IDE and have installed the eclipsoid plugin ([[How_to_install_Eclipsoid]]) you can use the wizard at "File > New > Other > New Java/Web z2-Project".