diff --git a/.gitignore b/.gitignore index 098034c..2482d4e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,8 @@ hs_err_pid* # NetBeans created artifacts /target/ -/nb-configuration.xml \ No newline at end of file +/nb-configuration.xml +.DS_Store +.classpath +.project +.settings diff --git a/README.md b/README.md index e129d42..b879c0c 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ Note that this project will just as well work with NetBeans, for which the cargo settings will be ignored. With NetBeans, you can just 'run' the project with a preconfigured Application Server (Tomcat 8). +The project also runs in Eclipse without any changes. + + # Docker This can be easily dockerized as well - a sample Dockerfile has been included. A version has been pushed to Docker Hub as well, although I cannot guarantee which version. To find it in Docker Hub: jdesmet/zakee-web:latest diff --git a/pom.xml b/pom.xml index aa18776..e54e5c2 100644 --- a/pom.xml +++ b/pom.xml @@ -116,6 +116,13 @@ need to include this api as compile (or default). --> + + org.glassfish.jersey.media + jersey-media-json-jackson + 2.25 + runtime + + @@ -158,6 +165,14 @@ 5.0.7.Final runtime + + + + org.eclipse.persistence + javax.persistence + 2.1.0 + + @@ -212,20 +233,36 @@ net.bootsfaces bootsfaces - 0.9.1 - compile + 1.1.2 + runtime org.primefaces primefaces - 6.0 + 6.1 compile org.primefaces.themes all-themes 1.0.10 - + + + + + org.jglue.cdi-unit + cdi-unit + 4.0.1 + test + + + junit + junit + 4.12 + test + + + @@ -264,7 +301,7 @@ tomcat8x - http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/8.5.9/tomcat-8.5.9.zip + http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/8.5.21/tomcat-8.5.21.zip diff --git a/src/main/java/io/desmet/jo/zakee/rs/ZakeeService.java b/src/main/java/io/desmet/jo/zakee/rs/ZakeeService.java index 0586f61..f2fbaff 100644 --- a/src/main/java/io/desmet/jo/zakee/rs/ZakeeService.java +++ b/src/main/java/io/desmet/jo/zakee/rs/ZakeeService.java @@ -34,14 +34,14 @@ public class ZakeeService { @Produces(MediaType.TEXT_HTML) @Path("context") public String processContextPath() { - return "

This "+contextPath+" service is life!

"; + return "This "+contextPath+" service is alife!"; } @GET @Produces(MediaType.TEXT_HTML) @Path("who") public String processWho() { - return "

Service for "+who.getYou().getFirstName()+"

"; + return "Service for "+who.getYou().getFirstName() + " (using CDI)"; } @PostConstruct diff --git a/src/main/webapp/index.xhtml b/src/main/webapp/index.xhtml index 124fd27..57ea76a 100644 --- a/src/main/webapp/index.xhtml +++ b/src/main/webapp/index.xhtml @@ -1,23 +1,54 @@ - + + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:b="http://bootsfaces.net/ui"> Introduce - - - - - - - - - + + + + + + + + + + +

If the text in the input field is "Guest", CDI works.

+
+
+
+ + + + Simple REST service: + #{request.contextPath}/rs/zakee-service/context + + Result: (waiting for the REST service result) + + + + REST service using CDI: + #{request.contextPath}/rs/zakee-service/who + + Result: (waiting for the REST service result) + + + + +
- - + \ No newline at end of file