diff --git a/.gitignore b/.gitignore
index a00e851..370e082 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,7 +45,8 @@
/Semester 2/Assignments/SwingTest/target/
/Semester 2/Assignments/MP2_BusinessLogic_CalebFontenot/target/
/Semester 2/lab_EL5_CalebFontenot/target/
-
/Semester 2/labJuneau_CalebFontenot/target/
/Semester 2/Assignments/LabJeaneauMessagesValidation_CalebFontenot/target/
/Semester 2/LabJuneauValidateUserInput_CalebFontenot/target/
+/Semester 2/Assignments/lab_EL5_CalebFontenot/target/
+/Semester 2/Assignments/labEL2_CalebFontenot/target/
diff --git a/Semester 2/Assignments/labEL2_CalebFontenot/target/labEL2_CalebFontenot-1.0-SNAPSHOT.war b/Semester 2/Assignments/labEL2_CalebFontenot/target/labEL2_CalebFontenot-1.0-SNAPSHOT.war
index f59285d..ee214f1 100644
Binary files a/Semester 2/Assignments/labEL2_CalebFontenot/target/labEL2_CalebFontenot-1.0-SNAPSHOT.war and b/Semester 2/Assignments/labEL2_CalebFontenot/target/labEL2_CalebFontenot-1.0-SNAPSHOT.war differ
diff --git a/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-archiver/pom.properties b/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-archiver/pom.properties
index 2b39a33..976c64f 100644
--- a/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-archiver/pom.properties
+++ b/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven
-#Fri Sep 08 10:22:26 CDT 2023
+#Fri Sep 29 15:02:58 CDT 2023
groupId=edu.slcc.asdv.caleb
artifactId=labEL2_CalebFontenot
version=1.0-SNAPSHOT
diff --git a/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index a60a2b3..73de940 100644
--- a/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,6 +1,6 @@
edu/slcc/asdv/beans/Purchases.class
-edu/slcc/asdv/pojos/Company.class
edu/slcc/asdv/beans/SimpleBean.class
+edu/slcc/asdv/pojos/Company.class
edu/slcc/asdv/pojos/Name.class
edu/slcc/asdv/bl/Utils.class
edu/slcc/asdv/pojos/Employee.class
diff --git a/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 6629679..0aff580 100644
--- a/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,10 +1,10 @@
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/JakartaRestConfiguration.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/resources/JakartaEE10Resource.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/bl/Utils.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java
-/home/caleb/ASDV-WebDev/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Purchases.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/bl/Utils.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/JakartaRestConfiguration.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Purchases.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/resources/JakartaEE10Resource.java
diff --git a/Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/LambdaAction.html b/Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/LambdaAction.html
new file mode 100644
index 0000000..54f1a7b
--- /dev/null
+++ b/Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/LambdaAction.html
@@ -0,0 +1,75 @@
+
+
+
+LambdaAction.java
+
+
+
+
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java
+
+package edu.slcc.asdv.beans;
+
+import jakarta.el.ELContext;
+import jakarta.el.LambdaExpression;
+import jakarta.inject.Named;
+import jakarta.enterprise.context.RequestScoped;
+import jakarta.faces.context.FacesContext;
+import java.util.ArrayList;
+
+
+
+
+
+@Named(value = "lambdaAction")
+@RequestScoped
+public class LambdaAction {
+
+
+
+
+ public LambdaAction() {
+ }
+
+ public Object lambda1(LambdaExpression lambdaExpression) {
+
+ FacesContext fc = FacesContext.getCurrentInstance();
+ ELContext elContext = fc.getELContext();
+ return lambdaExpression.invoke(elContext, 8, 3);
+ }
+
+ public ArrayList<String> lambda2(LambdaExpression lambdaExpression) {
+ ArrayList<String> returnArray = new ArrayList<>();
+
+ returnArray.add(lambdaExpression.invoke(1,2,3,4).toString());
+ returnArray.add(lambdaExpression.invoke(2,1,3,4).toString());
+ returnArray.add(lambdaExpression.invoke(2,3,1,4).toString());
+ returnArray.add(lambdaExpression.invoke(4,2,3,1).toString());
+ returnArray.add(lambdaExpression.invoke(4,2,1,1).toString());
+ returnArray.add(lambdaExpression.invoke(4,1,1,2).toString());
+ returnArray.add(lambdaExpression.invoke(1,1,4,2).toString());
+ returnArray.add(lambdaExpression.invoke(1,1,1,1).toString());
+ return returnArray;
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/index.html b/Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/index.html
new file mode 100644
index 0000000..9b53be9
--- /dev/null
+++ b/Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/index.html
@@ -0,0 +1,79 @@
+
+
+
+index.xhtml
+
+
+
+
+/home/caleb/ASDV-WebDev/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml |
+
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+ <h:head>
+ <title>Facelet Title</title>
+ </h:head>
+ <h:body>
+ <h3>Assignment operator, concatenation operator</h3>
+ {x = 3}: #{x = 3}<br/>
+ {y = x + 5}: #{y = x + 5}<br/>
+ {z = x + y}: #{z = x + y}<br/>
+
+ concatenation operator += {z += x} #{z += x}
+
+ <h3>; semicolon operator</h3>
+ {x = 5; y = 3; z = x + y}: #{x = 5; y = 3; z = x + y}<br/>
+ <h3>lambda expressions and conditional operator</h3>
+ {(x->x+1)(3)}: #{(x->x+1)(3)}<br/>
+ Declaration and use of lambda variables: #{squareOfNumber = ((x) -> x+x); squareOfNumber(4)}<br/>
+
+ use of lambda variable outside the initial {}: #{squareOfNumber(5)}<br/>
+
+ #{min=(x,y) -> (x lt y ? x : y); min(1,2)}<br/>
+ #{min(3, 4)}<br/>
+
+ <h3> call a bean method with EL as lambda expression</h3>
+
+ #{lambdaAction.lambda1(max = (x,y) -> x gt y ? x : y)}<br/>
+
+ <h3> Collections as lambda expression</h3>
+ set: #{set = {10,20,1,44}}<br/>
+ list: #{list = [100,2,20,33]}<br/>
+ map: #{map = {"one":1, "two":3, "four":4}} <br/>
+ sorting a list descending: #{list.stream().sorted((i,j)->i-j).toList()}<br/>
+ sorting a list ascending: #{list.stream().sorted((i,j)->j-i).toList()}<br/>
+
+ <h3>Traversing a lambda collection</h3>
+ <ui:repeat value="#{map.keySet().toArray()}" var="t">
+ <h:outputText value="key:#{t}
+ value: #{map.get(t)}"/><br/>
+ </ui:repeat>
+ <h3> Min of 4</h3>
+ #{lambdaAction.lambda2(min4 = (w, x, y, z) -> (w lt x) ? ((w lt y) ? ((w lt z) ? w : z) : ((y lt z) ? y : z)) : ((x lt y) ? ((x lt z) ? x : z) : ((y lt z) ? y : z)))};
+
+ </h:body>
+</html>
+
+
+
diff --git a/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java b/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java
index 09800a7..43d05a5 100644
--- a/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java
+++ b/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java
@@ -10,18 +10,22 @@ import jakarta.el.LambdaExpression;
import jakarta.inject.Named;
import jakarta.enterprise.context.RequestScoped;
import jakarta.faces.context.FacesContext;
+import java.util.ArrayList;
/**
*
* @author caleb
*/
-@Named(value="lambdaAction")
+@Named(value = "lambdaAction")
@RequestScoped
public class LambdaAction {
- /** Creates a new instance of LambdaAction */
+ /**
+ * Creates a new instance of LambdaAction
+ */
public LambdaAction() {
}
+
public Object lambda1(LambdaExpression lambdaExpression) {
// Useful in case of a custom ELContext
FacesContext fc = FacesContext.getCurrentInstance();
@@ -29,4 +33,17 @@ public class LambdaAction {
return lambdaExpression.invoke(elContext, 8, 3);
}
+ public ArrayList lambda2(LambdaExpression lambdaExpression) {
+ ArrayList returnArray = new ArrayList<>();
+
+ returnArray.add(lambdaExpression.invoke(1,2,3,4).toString());
+ returnArray.add(lambdaExpression.invoke(2,1,3,4).toString());
+ returnArray.add(lambdaExpression.invoke(2,3,1,4).toString());
+ returnArray.add(lambdaExpression.invoke(4,2,3,1).toString());
+ returnArray.add(lambdaExpression.invoke(4,2,1,1).toString());
+ returnArray.add(lambdaExpression.invoke(4,1,1,2).toString());
+ returnArray.add(lambdaExpression.invoke(1,1,4,2).toString());
+ returnArray.add(lambdaExpression.invoke(1,1,1,1).toString());
+ return returnArray;
+ }
}
diff --git a/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml b/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml
index 47b2b8d..b3e864a 100644
--- a/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml
+++ b/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml
@@ -11,35 +11,38 @@
{x = 3}: #{x = 3}
{y = x + 5}: #{y = x + 5}
{z = x + y}: #{z = x + y}
-
- concatenation operator += {z += x} #{z += x}
-
- ; semicolon operator
- {x = 5; y = 3; z = x + y}: #{x = 5; y = 3; z = x + y}
- lambda expressions and conditional operator
- {(x->x+1)(3)}: #{(x->x+1)(3)}
- Declaration and use of lambda variables: #{squareOfNumber = ((x) -> x+x); squareOfNumber(4)}
-
- use of lambda variable outside the initial {}: #{squareOfNumber(5)}
-
- #{min=(x,y) -> (x lt y ? x : y); min(1,2)}
- #{min(3, 4)}
-
- call a bean method with EL as lambda expression
-
- #{lambdaAction.lambda1(max = (x,y) -> x gt y ? x : y)}
-
- Collections as lambda expression
- set: #{set = {10,20,1,44}}
- list: #{list = [100,2,20,33]}
- map: #{map = {"one":1, "two":3, "four":4}}
- sorting a list descending: #{list.stream().sorted((i,j)->i-j).toList()}
- sorting a list ascending: #{list.stream().sorted((i,j)->j-i).toList()}
-
- Traversing a lambda collection
-
-
-
+
+ concatenation operator += {z += x} #{z += x}
+
+ ; semicolon operator
+ {x = 5; y = 3; z = x + y}: #{x = 5; y = 3; z = x + y}
+ lambda expressions and conditional operator
+ {(x->x+1)(3)}: #{(x->x+1)(3)}
+ Declaration and use of lambda variables: #{squareOfNumber = ((x) -> x+x); squareOfNumber(4)}
+
+ use of lambda variable outside the initial {}: #{squareOfNumber(5)}
+
+ #{min=(x,y) -> (x lt y ? x : y); min(1,2)}
+ #{min(3, 4)}
+
+ call a bean method with EL as lambda expression
+
+ #{lambdaAction.lambda1(max = (x,y) -> x gt y ? x : y)}
+
+ Collections as lambda expression
+ set: #{set = {10,20,1,44}}
+ list: #{list = [100,2,20,33]}
+ map: #{map = {"one":1, "two":3, "four":4}}
+ sorting a list descending: #{list.stream().sorted((i,j)->i-j).toList()}
+ sorting a list ascending: #{list.stream().sorted((i,j)->j-i).toList()}
+
+ Traversing a lambda collection
+
+
+
+ Min of 4
+ #{lambdaAction.lambda2(min4 = (w, x, y, z) -> (w lt x) ? ((w lt y) ? ((w lt z) ? w : z) : ((y lt z) ? y : z)) : ((x lt y) ? ((x lt z) ? x : z) : ((y lt z) ? y : z)))};
+