From a156cf6d0a93a2002f37756d20a989e3851b42ef Mon Sep 17 00:00:00 2001 From: Alex Aquino Date: Tue, 2 Oct 2018 22:49:28 -0300 Subject: [PATCH 1/2] Migrate JSF managed beans (deprecated) to CDI managed beans --- .DS_Store | Bin 0 -> 6148 bytes pom.xml | 78 ++++++++++++++++-------------- src/main/java/bean/HelloBean.java | 11 +++-- src/main/webapp/WEB-INF/beans.xml | 0 4 files changed, 47 insertions(+), 42 deletions(-) create mode 100644 .DS_Store create mode 100644 src/main/webapp/WEB-INF/beans.xml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7e0abc2f3769922bfc32ad0e7d84fb944bd02810 GIT binary patch literal 6148 zcmeHKO;5r=5Pb_6F>tp^f6x&0Knw?sccEaS7O4FYj{WJr*&T=oUOX6LX2{H& zosVVrm2_DEu3t~DfgXS^Rj_qNb3i07x+g7-oDiL#V~shoyqetA1Kl(k!_e51IBX8u479_rC+Gjo&-ee`CL0+8#=yT~z;y->gFd&UXY1bP|+P`xl7i9<{jn}Cc^?2mw_!HhBRrwn`o&y{6J literal 0 HcmV?d00001 diff --git a/pom.xml b/pom.xml index 13de472..1729f88 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,4 @@ - 4.0.0 com.microsoft @@ -8,39 +7,44 @@ war Sample JSF App - - - - com.sun.faces - jsf-api - 2.2.14 - - - com.sun.faces - jsf-impl - 2.2.14 - - - javax.servlet - javax.servlet-api - 3.1.0 - - - - - -ROOT - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.2 - - - 1.8 - 1.8 - - - - + + + + com.sun.faces + jsf-api + 2.2.14 + + + com.sun.faces + jsf-impl + 2.2.14 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + + org.jboss.weld.servlet + weld-servlet-shaded + 3.0.5.Final + + + + + ROOT + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.2 + + + 1.8 + 1.8 + + + + diff --git a/src/main/java/bean/HelloBean.java b/src/main/java/bean/HelloBean.java index bfcc377..80b1c5d 100644 --- a/src/main/java/bean/HelloBean.java +++ b/src/main/java/bean/HelloBean.java @@ -2,17 +2,18 @@ import java.io.Serializable; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.SessionScoped; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; -@ManagedBean +@Named @SessionScoped -public class HelloBean implements Serializable{ +public class HelloBean implements Serializable { private static final long serialVersionUID = -4823295172962937652L; private String message = "Your Java app is up and running on Azure"; - + + public String getMessage() { return message; } diff --git a/src/main/webapp/WEB-INF/beans.xml b/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..e69de29 From d98fdb799e15672d6bfe2fbc9b3108b524e776d2 Mon Sep 17 00:00:00 2001 From: Alex Aquino Date: Tue, 2 Oct 2018 22:50:34 -0300 Subject: [PATCH 2/2] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 7e0abc2f3769922bfc32ad0e7d84fb944bd02810..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO;5r=5Pb_6F>tp^f6x&0Knw?sccEaS7O4FYj{WJr*&T=oUOX6LX2{H& zosVVrm2_DEu3t~DfgXS^Rj_qNb3i07x+g7-oDiL#V~shoyqetA1Kl(k!_e51IBX8u479_rC+Gjo&-ee`CL0+8#=yT~z;y->gFd&UXY1bP|+P`xl7i9<{jn}Cc^?2mw_!HhBRrwn`o&y{6J