>();
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ String table = "";
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+ String sqlStr = "SELECT * FROM supplier";
+ try {
+ //prepare statement
+ ps = con.prepareStatement(sqlStr);
+ //execute
+ rs = ps.executeQuery();
+ while (rs.next()) {
+ String sNumber = rs.getString(1) + " ";
+ String sName = rs.getString(2) + " ";
+ String bdate = rs.getDate(3) + " ";
+ String status = rs.getInt(4) + " ";
+ String city = rs.getString(5) + " ";
+ table += sNumber + sName + bdate + status + city + "";
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ try {
+ closeDatabaseConnection(con);
+ // close the resources
+ if (ps != null) {
+ ps.close();
+ }
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ }
+ result = table;
+ }
+
+ public void viewSupplier()
+ {
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ String ret = "";
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+ String sqlStr = "SELECT snumber, sname, status, city, birthday FROM supplier WHERE snumber=?";
+ try {
+ //prepare statement
+ ps = con.prepareStatement(sqlStr);
+ ps.setString(1, snumber);
+ //execute
+ rs = ps.executeQuery();
+ if (rs.next()) {
+ this.snumber = rs.getString("snumber");
+ ret += this.snumber + " ";
+ this.sname = rs.getString("sname");
+ ret += this.sname + " ";
+ this.status = rs.getInt("status");
+ ret += this.status + " ";
+ this.city = rs.getString("city");
+ ret += this.city + " ";
+
+ Object bDate = rs.getObject("birthday");
+ this.birthday = bDate.toString();
+ ret += this.birthday;
+ } else {
+ ret = this.snumber + " doesn't exist.";
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ try {
+ this.closeDatabaseConnection(con);
+ if (ps != null) {
+ ps.close();
+ }
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ }
+ this.result = ret;
+ }
+}
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/bl/Supplier.java b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/bl/Supplier.java
new file mode 100644
index 0000000..f75ea89
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/bl/Supplier.java
@@ -0,0 +1,55 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.bl;
+
+/**
+ *
+ * @author caleb
+ */
+public class Supplier {
+
+ private String snumber;
+ private String sname;
+
+ public String getSname()
+ {
+ return sname;
+ }
+
+ public void setSname(String sname)
+ {
+ this.sname = sname;
+ }
+
+ private String birthday;
+
+ public String getBirthday()
+ {
+ return birthday;
+ }
+
+ public void setBirthday(String birthday)
+ {
+ this.birthday = birthday;
+ }
+
+
+ public String getSnumber()
+ {
+ return snumber;
+ }
+
+ public void setSnumber(String snumber)
+ {
+ this.snumber = snumber;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Supplier{" + "snumber=" + snumber + ", sname=" + sname + ", birthday=" + birthday + '}';
+ }
+
+}
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/bl/Suppliers.java b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/bl/Suppliers.java
new file mode 100644
index 0000000..8f402bc
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/bl/Suppliers.java
@@ -0,0 +1,380 @@
+package edu.slcc.asdv.bl;
+
+import java.io.Serializable;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Named;
+
+/**
+ *
+ * @author a. v. markou
+ */
+@Named(value = "suppliers")
+@ApplicationScoped
+public class Suppliers implements Serializable {
+
+ String snumber = "";
+ String sname = "";
+ int status = 0;
+ String birthday = "";
+ String city = "";
+ String result = "";
+
+
+
+ public Suppliers()
+ {
+ connection();
+ }
+
+ public String getSnumber()
+ {
+ return snumber;
+ }
+
+ public void setSnumber(String snumber)
+ {
+ this.snumber = snumber;
+ }
+
+ public String getSname()
+ {
+ return sname;
+ }
+
+ public void setSname(String sname)
+ {
+ this.sname = sname;
+ }
+
+ public int getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(int status)
+ {
+ this.status = status;
+ }
+
+ public String getBirthday()
+ {
+ return birthday;
+ }
+
+ public void setBirthday(String birthday)
+ {
+ this.birthday = birthday;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ public String getConnectionResponse()
+ {
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return null;
+ }
+ if (con != null) {
+ return "Connection succesfull!
";
+ } else {
+ connection();
+ return "
Connection failed!
";
+ }
+
+ }
+
+ private Connection connection() //throws InstantiationException, IllegalAccessException
+ {
+ /*
+ String databaseName = "suppliers_parts_23";
+ String userName = "admin";
+ String password = "RangerDog01!";
+ String URL2 = "com.mysql.jdbc.Driver";
+ Connection con = null;
+ */
+
+
+ try {// Load Sun's jdbc driver
+ Class.forName(URL2).newInstance();
+ System.out.println("JDBC Driver loaded!");
+ } catch (Exception e) // driver not found
+ {
+ System.err.println("Unable to load database driver");
+ System.err.println("Details : " + e);
+ return null;
+ }
+ String ip = "localhost"; //internet connection
+ String url = "jdbc:mysql://" + ip + ":3306/" + databaseName + "?useSSL=false";
+ System.out.println(url);
+ try {
+ con = DriverManager.getConnection(url, userName, password);
+ con.setReadOnly(false);
+ } catch (Exception e) {
+ System.err.println(e.toString());
+ return null;
+ }
+ System.out.println("connection successfull");
+ return con;
+ }
+
+ public void clear()
+ {
+ status = 0;
+ snumber = "";
+ sname = "";
+ birthday = "";
+ city = "";
+ result = "";
+ }
+
+ public void listAll()
+ {
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ String table = "";
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+ String sqlStr = "SELECT * FROM supplier";
+ try {
+ //prepare statement
+ ps = con.prepareStatement(sqlStr);
+ //execute
+ rs = ps.executeQuery();
+ int row = 0;
+ while (rs.next()) {
+ String sNumber = rs.getString(1) + " ";
+ String sName = rs.getString(2) + " ";
+ String bdate = rs.getDate(3) + " ";
+ String status = rs.getInt(4) + " ";
+ String city = rs.getString(5) + " ";
+ table += sNumber + sName + bdate + status + city + "";
+ row++;
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ try {
+ closeDatabaseConnection(con);
+ // close the resources
+ if (ps != null) {
+ ps.close();
+ }
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ }
+ result = table;
+ }
+
+ public void viewSupplier()
+ {
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ String ret = "";
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+ String sqlStr = "SELECT snumber, sname, status, city, birthday FROM supplier WHERE snumber=?";
+ try {
+ //prepare statement
+ ps = con.prepareStatement(sqlStr);
+ ps.setString(1, snumber);
+ //execute
+ rs = ps.executeQuery();
+ if (rs.next()) {
+ this.snumber = rs.getString("snumber");
+ ret += this.snumber + " ";
+ this.sname = rs.getString("sname");
+ ret += this.sname + " ";
+ this.status = rs.getInt("status");
+ ret += this.status + " ";
+ this.city = rs.getString("city");
+ ret += this.city + " ";
+
+ Object bDate = rs.getObject("birthday");
+ this.birthday = bDate.toString();
+ ret += this.birthday;
+ } else {
+ ret = this.snumber + " doesn't exist.";
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ try {
+ this.closeDatabaseConnection(con);
+ if (ps != null) {
+ ps.close();
+ }
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ }
+ this.result = ret;
+ }
+
+ public void updateSupplier()
+ {
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ PreparedStatement updateSupplier = null;
+ try {
+
+ updateSupplier = con.prepareStatement(
+ "UPDATE supplier SET snumber=?, sname=?, status=?, birthday=?, city=? WHERE snumber=?");
+
+ updateSupplier.setString(1, snumber);
+ updateSupplier.setString(2, sname);
+ updateSupplier.setInt(3, status);
+ java.sql.Date bd = stringDateToSqlDate(this.birthday);
+ updateSupplier.setDate(4, bd);
+ updateSupplier.setString(5, city);
+ updateSupplier.setString(6, snumber);
+ int updateCount = updateSupplier.executeUpdate();
+
+ result = "number of rows affected: " + updateCount;
+
+ } catch (Exception ex) {
+ System.err.println(ex.toString());
+ } finally {
+ try {
+ this.closeDatabaseConnection(con);
+ // close the resources
+ if (updateSupplier != null) {
+ updateSupplier.close();
+ }
+
+ } catch (SQLException sqlee) {
+ sqlee.printStackTrace();
+ }
+ }
+ }
+
+ public void deleteSupplier()
+ {
+
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ PreparedStatement ps = null;
+ int rowsAffected = -1;
+
+ try {
+ String query = "DELETE FROM supplier WHERE snumber=? ";
+ ps = con.prepareStatement(query);
+ ps.setString(1, snumber);
+ rowsAffected = ps.executeUpdate();
+ result = "number of rows affected: " + rowsAffected;
+ } catch (Exception ex) {
+ System.err.println(ex.toString());
+ } finally {
+ try {
+ this.closeDatabaseConnection(con);
+ // close the resources
+ if (ps != null) {
+ ps.close();
+ }
+
+ } catch (SQLException sqlee) {
+ sqlee.printStackTrace();
+ }
+ }
+ }
+
+ public void insertSupplier()
+ {
+ Connection con = connection();
+ if (con == null) {
+ result = "cannot connect to database";
+ return;
+ }
+ PreparedStatement updateSupplier = null;
+ try {
+ updateSupplier = con.prepareStatement(
+ "INSERT INTO supplier (snumber, sname, status, birthday, city ) "
+ + "VALUES ( ?, ?, ? , ? ,? )");
+ updateSupplier.setString(1, snumber);
+ updateSupplier.setString(2, sname);
+ updateSupplier.setInt(3, status);
+ java.sql.Date sqlDate = stringDateToSqlDate(birthday);
+ updateSupplier.setDate(4, sqlDate);
+ updateSupplier.setString(5, city);
+
+ int updateCount = updateSupplier.executeUpdate();
+
+ result = "number of rows affected: " + updateCount;
+ } catch (Exception ex) {
+ System.err.println(ex.toString());
+ result = ex.toString();
+ } finally {
+ try {
+ this.closeDatabaseConnection(con);
+ // close the resources
+ if (updateSupplier != null) {
+ updateSupplier.close();
+ }
+
+ } catch (SQLException e) {
+ System.err.println(e.toString());
+ result = e.toString();
+ }
+ }
+ }
+
+ private java.sql.Date stringDateToSqlDate(String sDate)
+ {
+ java.util.Date date = null;
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ try {
+ date = sdf.parse(sDate);
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ return new java.sql.Date(date.getTime());
+
+ }
+
+ public String getResult()
+ {
+ return "
Suppliers
" + result;
+
+ }
+
+ public void closeDatabaseConnection(Connection con)
+ {
+ try {
+ if (con != null) {
+ con.close();
+ }
+ } catch (SQLException e) {
+ result = e.toString();
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/suppliers_parts/JakartaRestConfiguration.java b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/suppliers_parts/JakartaRestConfiguration.java
new file mode 100644
index 0000000..d9a2934
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/suppliers_parts/JakartaRestConfiguration.java
@@ -0,0 +1,13 @@
+package edu.slcc.asdv.suppliers_parts;
+
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
+
+/**
+ * Configures Jakarta RESTful Web Services for the application.
+ * @author Juneau
+ */
+@ApplicationPath("resources")
+public class JakartaRestConfiguration extends Application {
+
+}
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/suppliers_parts/resources/JakartaEE10Resource.java b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/suppliers_parts/resources/JakartaEE10Resource.java
new file mode 100644
index 0000000..104ce24
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/java/edu/slcc/asdv/suppliers_parts/resources/JakartaEE10Resource.java
@@ -0,0 +1,20 @@
+package edu.slcc.asdv.suppliers_parts.resources;
+
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.core.Response;
+
+/**
+ *
+ * @author
+ */
+@Path("jakartaee10")
+public class JakartaEE10Resource {
+
+ @GET
+ public Response ping(){
+ return Response
+ .ok("ping Jakarta EE")
+ .build();
+ }
+}
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/resources/META-INF/persistence.xml b/Semester 2/Assignments/suppliers_parts/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..7582bf1
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/SelectAllFromTable.xhtml b/Semester 2/Assignments/suppliers_parts/src/main/webapp/SelectAllFromTable.xhtml
new file mode 100644
index 0000000..517c356
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/SelectAllFromTable.xhtml
@@ -0,0 +1,21 @@
+
+
+
+
+ Facelet Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/beans.xml b/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..9dfae34
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/glassfish-web.xml
new file mode 100644
index 0000000..584a477
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/glassfish-web.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+ Keep a copy of the generated servlet class' java code.
+
+
+
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/web.xml b/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..fcfcd54
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+
+
+
+ jakarta.faces.PROJECT_STAGE
+ Development
+
+
+ Faces Servlet
+ jakarta.faces.webapp.FacesServlet
+ 1
+
+
+ Faces Servlet
+ /faces/*
+
+
+
+ 30
+
+
+
+ faces/index.xhtml
+
+
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/index.xhtml b/Semester 2/Assignments/suppliers_parts/src/main/webapp/index.xhtml
new file mode 100644
index 0000000..4b4a219
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/index.xhtml
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Supplier Parts DB
+
+
+
+
+ Suppliers-Parts Database
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/resources/css/styles.css b/Semester 2/Assignments/suppliers_parts/src/main/webapp/resources/css/styles.css
new file mode 100644
index 0000000..9d96af6
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/resources/css/styles.css
@@ -0,0 +1,71 @@
+.body {
+ background: #eee;
+}
+
+.button {
+ margin: 10px;
+ border-left: thin solid darkGray;
+ border-bottom: thin solid darkGray;
+ border-top: thin solid lightGray;
+ border-right: thin solid lightGray;
+ color: #777;
+ background: #A7C942;
+ font-family: "Comic Sans MS";
+ border-radius: 20%;
+}
+h1
+{
+ vertical-align: top;
+ text-align: middle;
+ font-style: italic;
+ color: #888;
+ font-size: 2em;
+ font-family: "Comic Sans MS";
+
+}
+
+.label
+{
+ color: #888;
+ font-size: 0.8em;
+ font-family: "Comic Sans MS";
+}
+.leftImage {
+ float: left;
+ margin-right: 1em;
+}
+
+.backLink {
+ font-style: italic;
+}
+
+
+.tableHeader {
+ font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
+ border-collapse:collapse;
+ font-size:1.1em;
+ text-align:left;
+ padding-top:5px;
+ padding-bottom:4px;
+ background-color:#A7C942;
+ color:white;
+ border:1px solid #98bf21;
+}
+
+.oddTableRow {
+ border:1px solid #98bf21;
+}
+
+.evenTableRow {
+ background-color: #eeeeee;
+ font-size:1em;
+
+ padding:3px 7px 2px 7px;
+
+ color:#000000;
+ background-color:#EAF2D3;
+}
+
+.table {
+ border:1px solid green;
+}
\ No newline at end of file
diff --git a/Semester 2/Assignments/suppliers_parts/src/main/webapp/supplier.xhtml b/Semester 2/Assignments/suppliers_parts/src/main/webapp/supplier.xhtml
new file mode 100644
index 0000000..30ace59
--- /dev/null
+++ b/Semester 2/Assignments/suppliers_parts/src/main/webapp/supplier.xhtml
@@ -0,0 +1,14 @@
+
+
+
+
+ Facelet Title
+
+
+ Hello from Facelets
+
+
+
+
+
diff --git a/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/Registration.java b/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/Registration.java
index f33d2ca..4e580e2 100644
--- a/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/Registration.java
+++ b/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/Registration.java
@@ -1,112 +1,13 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
- * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
-
package beans;
-import jakarta.inject.Named;
-import jakarta.enterprise.context.RequestScoped;
-
/**
*
* @author caleb
*/
-@Named(value="registration")
-@RequestScoped
public class Registration {
-
- private String lastName;
- private String firstName;
- private String mi;
- private String gender;
-
- /**
- * Get the value of gender
- *
- * @return the value of gender
- */
- public String getGender()
- {
- return gender;
- }
-
- /**
- * Set the value of gender
- *
- * @param gender new value of gender
- */
- public void setGender(String gender)
- {
- this.gender = gender;
- }
-
-
- public String getMi()
- {
- return mi;
- }
-
- public void setMi(String mi)
- {
- this.mi = mi;
- }
-
-
- /**
- * Get the value of firstName
- *
- * @return the value of firstName
- */
- public String getFirstName()
- {
- return firstName;
- }
-
- /**
- * Set the value of firstName
- *
- * @param firstName new value of firstName
- */
- public void setFirstName(String firstName)
- {
- this.firstName = firstName;
- }
-
-
- public String getLastName()
- {
- return lastName;
- }
-
- public void setLastName(String lastName)
- {
- this.lastName = lastName;
- }
- public String getResponse()
- {
- if (lastName == null) {
- return ""; // Request has not been made
- } else {
- String allMinor = "";
- for (String s : minor) {
- allMinor += s + " ";
- }
-
- String allHobby = "";
- for (String s : hobby) {
- allHobby += s + " ";
- }
-
- return "
You entered
"
- + "Last Name: " + lastName + "
"
- + "First Name: " + firstName + "
"
- + "MI: " + mi + "
"
- + "Gender: " + gender + "
"
- + "Major: " + major + "
"
- + "Minor: " + allMinor + "
"
- + "Hobby: " + allHobby + "
"
- + "Remarks: " + remarks + "
";
- }
- }
+
}
diff --git a/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/RegistrationInterface.java b/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/RegistrationInterface.java
new file mode 100644
index 0000000..99ed4d6
--- /dev/null
+++ b/Semester 2/Multicomponents_Lab_CalebFontenot/src/main/java/beans/RegistrationInterface.java
@@ -0,0 +1,112 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
+ */
+
+package beans;
+
+import jakarta.inject.Named;
+import jakarta.enterprise.context.RequestScoped;
+
+/**
+ *
+ * @author caleb
+ */
+@Named(value="registration")
+@RequestScoped
+public class RegistrationInterface {
+
+ private String lastName;
+ private String firstName;
+ private String mi;
+ private String gender;
+
+ /**
+ * Get the value of gender
+ *
+ * @return the value of gender
+ */
+ public String getGender()
+ {
+ return gender;
+ }
+
+ /**
+ * Set the value of gender
+ *
+ * @param gender new value of gender
+ */
+ public void setGender(String gender)
+ {
+ this.gender = gender;
+ }
+
+
+ public String getMi()
+ {
+ return mi;
+ }
+
+ public void setMi(String mi)
+ {
+ this.mi = mi;
+ }
+
+
+ /**
+ * Get the value of firstName
+ *
+ * @return the value of firstName
+ */
+ public String getFirstName()
+ {
+ return firstName;
+ }
+
+ /**
+ * Set the value of firstName
+ *
+ * @param firstName new value of firstName
+ */
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+
+ public String getLastName()
+ {
+ return lastName;
+ }
+
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+ public String getResponse()
+ {
+ if (lastName == null) {
+ return ""; // Request has not been made
+ } else {
+ String allMinor = "";
+ for (String s : minor) {
+ allMinor += s + " ";
+ }
+
+ String allHobby = "";
+ for (String s : hobby) {
+ allHobby += s + " ";
+ }
+
+ return "You entered
"
+ + "Last Name: " + lastName + "
"
+ + "First Name: " + firstName + "
"
+ + "MI: " + mi + "
"
+ + "Gender: " + gender + "
"
+ + "Major: " + major + "
"
+ + "Minor: " + allMinor + "
"
+ + "Hobby: " + allHobby + "
"
+ + "Remarks: " + remarks + "
";
+ }
+ }
+}
diff --git a/Semester 2/SelectAll/faces-config.NavData b/Semester 2/SelectAll/faces-config.NavData
new file mode 100644
index 0000000..e69de29
diff --git a/Semester 2/SelectAll/nb-configuration.xml b/Semester 2/SelectAll/nb-configuration.xml
new file mode 100644
index 0000000..5e1a2de
--- /dev/null
+++ b/Semester 2/SelectAll/nb-configuration.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ 10-web
+ gfv700ee10
+ Facelets
+
+
diff --git a/Semester 2/SelectAll/pom.xml b/Semester 2/SelectAll/pom.xml
new file mode 100644
index 0000000..99d83d8
--- /dev/null
+++ b/Semester 2/SelectAll/pom.xml
@@ -0,0 +1,42 @@
+
+ 4.0.0
+ edu.slcc.asdv.caleb
+ SelectAll
+ 1.0-SNAPSHOT
+ war
+ SelectAll-1.0-SNAPSHOT
+
+
+ UTF-8
+ 10.0.0
+
+
+
+
+ jakarta.platform
+ jakarta.jakartaee-api
+ ${jakartaee}
+ provided
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+
+ 11
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 3.3.2
+
+
+
+
\ No newline at end of file
diff --git a/Semester 2/SelectAll/src/main/java/com/RegisterForm.java b/Semester 2/SelectAll/src/main/java/com/RegisterForm.java
new file mode 100644
index 0000000..4a57c5d
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/java/com/RegisterForm.java
@@ -0,0 +1,132 @@
+package com.corejsf;
+
+import java.awt.Color;
+import java.io.Serializable;
+import java.text.DateFormatSymbols;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.faces.bean.ManagedBean;
+ // or import javax.inject.Named;
+import javax.faces.bean.SessionScoped;
+ // or import javax.enterprise.context.SessionScoped;
+import javax.faces.model.SelectItem;
+
+@ManagedBean(name="form") // or @Named("form")
+@SessionScoped
+public class RegisterForm implements Serializable {
+ public enum Education { HIGH_SCHOOL, BACHELOR, MASTER, DOCTOR };
+
+ public static class Weekday {
+ private int dayOfWeek;
+ public Weekday(int dayOfWeek) {
+ this.dayOfWeek = dayOfWeek;
+ }
+
+ public String getDayName() {
+ DateFormatSymbols symbols = new DateFormatSymbols();
+ String[] weekdays = symbols.getWeekdays();
+ return weekdays[dayOfWeek];
+ }
+
+ public int getDayNumber() {
+ return dayOfWeek;
+ }
+ }
+
+ private String name;
+ private boolean contactMe;
+ private int[] bestDaysToContact;
+ private Integer yearOfBirth;
+ private int[] colors;
+ private Set languages = new TreeSet();
+ private Education education = Education.BACHELOR;
+
+ public String getName() { return name; }
+ public void setName(String newValue) { name = newValue; }
+
+ public boolean getContactMe() { return contactMe; }
+ public void setContactMe(boolean newValue) { contactMe = newValue; }
+
+ public int[] getBestDaysToContact() { return bestDaysToContact; }
+ public void setBestDaysToContact(int[] newValue) { bestDaysToContact = newValue; }
+
+ public Integer getYearOfBirth() { return yearOfBirth; }
+ public void setYearOfBirth(Integer newValue) { yearOfBirth = newValue; }
+
+ public int[] getColors() { return colors; }
+ public void setColors(int[] newValue) { colors = newValue; }
+
+ public Set getLanguages() { return languages; }
+ public void setLanguages(Set newValue) { languages = newValue; }
+
+ public Education getEducation() { return education; }
+ public void setEducation(Education newValue) { education = newValue; }
+
+ public Collection getYearItems() { return birthYears; }
+
+ public Weekday[] getDaysOfTheWeek() { return daysOfTheWeek; }
+
+ public SelectItem[] getLanguageItems() { return languageItems; }
+
+ public SelectItem[] getColorItems() { return colorItems; }
+
+ public Map getEducationItems() { return educationItems; }
+
+ public String getBestDaysConcatenated() {
+ return Arrays.toString(bestDaysToContact);
+ }
+
+ public String getColorsConcatenated() {
+ StringBuilder result = new StringBuilder();
+ for (int color : colors) result.append(String.format("%06x ", color));
+ return result.toString();
+ }
+
+ private SelectItem[] colorItems = {
+ new SelectItem(Color.RED.getRGB(), "Red"), // value, label
+ new SelectItem(Color.GREEN.getRGB(), "Green"),
+ new SelectItem(Color.BLUE.getRGB(), "Blue"),
+ new SelectItem(Color.YELLOW.getRGB(), "Yellow"),
+ new SelectItem(Color.ORANGE.getRGB(), "Orange", "", true) // disabled
+ };
+
+ private static Map educationItems;
+ static {
+ educationItems = new LinkedHashMap();
+ educationItems.put("High School", Education.HIGH_SCHOOL); // label, value
+ educationItems.put("Bachelor's", Education.BACHELOR);
+ educationItems.put("Master's", Education.MASTER);
+ educationItems.put("Doctorate", Education.DOCTOR);
+ };
+
+ private static SelectItem[] languageItems = {
+ new SelectItem("English"),
+ new SelectItem("French"),
+ new SelectItem("Russian"),
+ new SelectItem("Italian"),
+ new SelectItem("Esperanto", "Esperanto", "", true) // disabled
+ };
+
+ private static Collection birthYears;
+ static {
+ birthYears = new ArrayList();
+ // The first item is a "no selection" item
+ birthYears.add(new SelectItem(null, "Pick a year:", "", false, false, true));
+ for (int i = 1900; i < 2020; ++i) birthYears.add(new SelectItem(i));
+ }
+
+ private static Weekday[] daysOfTheWeek;
+ static {
+ daysOfTheWeek = new Weekday[7];
+ for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
+ daysOfTheWeek[i - Calendar.SUNDAY] = new Weekday(i);
+ }
+ }
+}
diff --git a/Semester 2/SelectAll/src/main/java/com/corejsf/RegisterForm.java b/Semester 2/SelectAll/src/main/java/com/corejsf/RegisterForm.java
new file mode 100644
index 0000000..3e83e55
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/java/com/corejsf/RegisterForm.java
@@ -0,0 +1,130 @@
+package com.corejsf;
+
+import jakarta.enterprise.context.SessionScoped;
+import java.awt.Color;
+import java.io.Serializable;
+import java.text.DateFormatSymbols;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import jakarta.faces.model.SelectItem;
+import jakarta.inject.Named;
+
+@Named("form") // or @Named("form")
+@SessionScoped
+public class RegisterForm implements Serializable {
+ public enum Education { HIGH_SCHOOL, BACHELOR, MASTER, DOCTOR };
+
+ public static class Weekday {
+ private int dayOfWeek;
+ public Weekday(int dayOfWeek) {
+ this.dayOfWeek = dayOfWeek;
+ }
+
+ public String getDayName() {
+ DateFormatSymbols symbols = new DateFormatSymbols();
+ String[] weekdays = symbols.getWeekdays();
+ return weekdays[dayOfWeek];
+ }
+
+ public int getDayNumber() {
+ return dayOfWeek;
+ }
+ }
+
+ private String name;
+ private boolean contactMe;
+ private int[] bestDaysToContact;
+ private Integer yearOfBirth;
+ private int[] colors;
+ private Set languages = new TreeSet();
+ private Education education = Education.BACHELOR;
+
+ public String getName() { return name; }
+ public void setName(String newValue) { name = newValue; }
+
+ public boolean getContactMe() { return contactMe; }
+ public void setContactMe(boolean newValue) { contactMe = newValue; }
+
+ public int[] getBestDaysToContact() { return bestDaysToContact; }
+ public void setBestDaysToContact(int[] newValue) { bestDaysToContact = newValue; }
+
+ public Integer getYearOfBirth() { return yearOfBirth; }
+ public void setYearOfBirth(Integer newValue) { yearOfBirth = newValue; }
+
+ public int[] getColors() { return colors; }
+ public void setColors(int[] newValue) { colors = newValue; }
+
+ public Set getLanguages() { return languages; }
+ public void setLanguages(Set newValue) { languages = newValue; }
+
+ public Education getEducation() { return education; }
+ public void setEducation(Education newValue) { education = newValue; }
+
+ public Collection getYearItems() { return birthYears; }
+
+ public Weekday[] getDaysOfTheWeek() { return daysOfTheWeek; }
+
+ public SelectItem[] getLanguageItems() { return languageItems; }
+
+ public SelectItem[] getColorItems() { return colorItems; }
+
+ public Map getEducationItems() { return educationItems; }
+
+ public String getBestDaysConcatenated() {
+ return Arrays.toString(bestDaysToContact);
+ }
+
+ public String getColorsConcatenated() {
+ StringBuilder result = new StringBuilder();
+ for (int color : colors) result.append(String.format("%06x ", color));
+ return result.toString();
+ }
+
+ private SelectItem[] colorItems = {
+ new SelectItem(Color.RED.getRGB(), "Red"), // value, label
+ new SelectItem(Color.GREEN.getRGB(), "Green"),
+ new SelectItem(Color.BLUE.getRGB(), "Blue"),
+ new SelectItem(Color.YELLOW.getRGB(), "Yellow"),
+ new SelectItem(Color.ORANGE.getRGB(), "Orange", "", true) // disabled
+ };
+
+ private static Map educationItems;
+ static {
+ educationItems = new LinkedHashMap();
+ educationItems.put("High School", Education.HIGH_SCHOOL); // label, value
+ educationItems.put("Bachelor's", Education.BACHELOR);
+ educationItems.put("Master's", Education.MASTER);
+ educationItems.put("Doctorate", Education.DOCTOR);
+ };
+
+ private static SelectItem[] languageItems = {
+ new SelectItem("English"),
+ new SelectItem("French"),
+ new SelectItem("Russian"),
+ new SelectItem("Italian"),
+ new SelectItem("Esperanto", "Esperanto", "", true) // disabled
+ };
+
+ private static Collection birthYears;
+ static {
+ birthYears = new ArrayList();
+ // The first item is a "no selection" item
+ birthYears.add(new SelectItem(null, "Pick a year:", "", false, false, true));
+ for (int i = 1900; i < 2020; ++i) birthYears.add(new SelectItem(i));
+ }
+
+ private static Weekday[] daysOfTheWeek;
+ static {
+ daysOfTheWeek = new Weekday[7];
+ for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
+ daysOfTheWeek[i - Calendar.SUNDAY] = new Weekday(i);
+ }
+ }
+}
diff --git a/Semester 2/SelectAll/src/main/java/com/messages.properties b/Semester 2/SelectAll/src/main/java/com/messages.properties
new file mode 100644
index 0000000..00bf8af
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/java/com/messages.properties
@@ -0,0 +1,21 @@
+indexWindowTitle=Checkboxes, Radio buttons, Menus, and Listboxes
+indexPageTitle=Please fill out the following information
+
+namePrompt=Name:
+contactMePrompt=Contact me
+bestDayPrompt=What's the best day to contact you?
+yearOfBirthPrompt=What year were you born?
+buttonPrompt=Submit information
+backPrompt=Back
+languagePrompt=Select the languages you speak:
+educationPrompt=Select your highest education level:
+emailAppPrompt=Select your email application:
+colorPrompt=Select your favorite colors:
+
+thankYouLabel=Thank you {0}, for your information
+contactMeLabel=Contact me:
+bestDayLabel=Best day to contact you:
+yearOfBirthLabel=Your year of birth:
+colorLabel=Colors:
+languageLabel=Languages:
+educationLabel=Education:
\ No newline at end of file
diff --git a/Semester 2/SelectAll/src/main/java/edu/slcc/asdv/caleb/selectall/JakartaRestConfiguration.java b/Semester 2/SelectAll/src/main/java/edu/slcc/asdv/caleb/selectall/JakartaRestConfiguration.java
new file mode 100644
index 0000000..79f3bea
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/java/edu/slcc/asdv/caleb/selectall/JakartaRestConfiguration.java
@@ -0,0 +1,13 @@
+package edu.slcc.asdv.caleb.selectall;
+
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
+
+/**
+ * Configures Jakarta RESTful Web Services for the application.
+ * @author Juneau
+ */
+@ApplicationPath("resources")
+public class JakartaRestConfiguration extends Application {
+
+}
diff --git a/Semester 2/SelectAll/src/main/java/edu/slcc/asdv/caleb/selectall/resources/JakartaEE10Resource.java b/Semester 2/SelectAll/src/main/java/edu/slcc/asdv/caleb/selectall/resources/JakartaEE10Resource.java
new file mode 100644
index 0000000..726296e
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/java/edu/slcc/asdv/caleb/selectall/resources/JakartaEE10Resource.java
@@ -0,0 +1,20 @@
+package edu.slcc.asdv.caleb.selectall.resources;
+
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.core.Response;
+
+/**
+ *
+ * @author
+ */
+@Path("jakartaee10")
+public class JakartaEE10Resource {
+
+ @GET
+ public Response ping(){
+ return Response
+ .ok("ping Jakarta EE")
+ .build();
+ }
+}
diff --git a/Semester 2/SelectAll/src/main/resources/META-INF/persistence.xml b/Semester 2/SelectAll/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..7582bf1
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Semester 2/SelectAll/src/main/resources/messages.properties b/Semester 2/SelectAll/src/main/resources/messages.properties
new file mode 100644
index 0000000..00bf8af
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/resources/messages.properties
@@ -0,0 +1,21 @@
+indexWindowTitle=Checkboxes, Radio buttons, Menus, and Listboxes
+indexPageTitle=Please fill out the following information
+
+namePrompt=Name:
+contactMePrompt=Contact me
+bestDayPrompt=What's the best day to contact you?
+yearOfBirthPrompt=What year were you born?
+buttonPrompt=Submit information
+backPrompt=Back
+languagePrompt=Select the languages you speak:
+educationPrompt=Select your highest education level:
+emailAppPrompt=Select your email application:
+colorPrompt=Select your favorite colors:
+
+thankYouLabel=Thank you {0}, for your information
+contactMeLabel=Contact me:
+bestDayLabel=Best day to contact you:
+yearOfBirthLabel=Your year of birth:
+colorLabel=Colors:
+languageLabel=Languages:
+educationLabel=Education:
\ No newline at end of file
diff --git a/Semester 2/SelectAll/src/main/webapp/WEB-INF/beans.xml b/Semester 2/SelectAll/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..4ca8195
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/Semester 2/SelectAll/src/main/webapp/WEB-INF/faces-config.xml b/Semester 2/SelectAll/src/main/webapp/WEB-INF/faces-config.xml
new file mode 100644
index 0000000..cc8aea6
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/WEB-INF/faces-config.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ messages
+ messages
+
+
+
\ No newline at end of file
diff --git a/Semester 2/SelectAll/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/SelectAll/src/main/webapp/WEB-INF/glassfish-web.xml
new file mode 100644
index 0000000..673cc06
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/WEB-INF/glassfish-web.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+ Keep a copy of the generated servlet class' java code.
+
+
+
diff --git a/Semester 2/SelectAll/src/main/webapp/WEB-INF/web.xml b/Semester 2/SelectAll/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..00cfff4
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,23 @@
+
+
+
+ Faces Servlet
+ jakarta.faces.webapp.FacesServlet
+
+
+ Faces Servlet
+ /faces/*
+
+
+ faces/index.xhtml
+
+
+ jakarta.faces.PROJECT_STAGE
+ Development
+
+
\ No newline at end of file
diff --git a/Semester 2/SelectAll/src/main/webapp/index.xhtml b/Semester 2/SelectAll/src/main/webapp/index.xhtml
new file mode 100644
index 0000000..52451b6
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/index.xhtml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ #{messages.indexWindowTitle}
+
+
+
+
+
+
+ #{messages.namePrompt}
+
+ #{messages.contactMePrompt}
+
+ #{messages.bestDayPrompt}
+
+
+
+ #{messages.yearOfBirthPrompt}
+
+
+
+ #{messages.colorPrompt}
+
+
+
+ #{messages.languagePrompt}
+
+
+
+ #{messages.educationPrompt}
+
+
+
+
+
+
+
+
+
diff --git a/Semester 2/SelectAll/src/main/webapp/resources/css/styles.css b/Semester 2/SelectAll/src/main/webapp/resources/css/styles.css
new file mode 100644
index 0000000..aa86105
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/resources/css/styles.css
@@ -0,0 +1,10 @@
+.emphasis {
+ font-style: italic;
+ font-size: 1.3em;
+}
+.disabled {
+ color: gray;
+}
+.selected {
+ font-weight: bold;
+}
\ No newline at end of file
diff --git a/Semester 2/SelectAll/src/main/webapp/showInformation.xhtml b/Semester 2/SelectAll/src/main/webapp/showInformation.xhtml
new file mode 100644
index 0000000..0ea7f0f
--- /dev/null
+++ b/Semester 2/SelectAll/src/main/webapp/showInformation.xhtml
@@ -0,0 +1,32 @@
+
+
+
+
+ #{messages.indexWindowTitle}
+
+
+
+
+
+
+
+
+ #{messages.contactMeLabel}
+
+ #{messages.bestDayLabel}
+
+ #{messages.yearOfBirthLabel}
+
+ #{messages.languageLabel}
+
+ #{messages.colorLabel}
+
+ #{messages.educationLabel}
+
+
+
+
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/nb-configuration.xml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/nb-configuration.xml
new file mode 100644
index 0000000..5e1a2de
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/nb-configuration.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ 10-web
+ gfv700ee10
+ Facelets
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/pom.xml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/pom.xml
new file mode 100644
index 0000000..0674981
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/pom.xml
@@ -0,0 +1,42 @@
+
+ 4.0.0
+ edu.slcc.asdv.caleb
+ Multicomponents2_Lab_CalebFontenot
+ 1.0-SNAPSHOT
+ war
+ Multicomponents2_Lab_CalebFontenot-1.0-SNAPSHOT
+
+
+ UTF-8
+ 10.0.0
+
+
+
+
+ jakarta.platform
+ jakarta.jakartaee-api
+ ${jakartaee}
+ provided
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+
+ 11
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 3.3.2
+
+
+
+
\ No newline at end of file
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/beans/Registration.java b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/beans/Registration.java
new file mode 100644
index 0000000..838157f
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/beans/Registration.java
@@ -0,0 +1,203 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
+ */
+
+package beans;
+
+import jakarta.inject.Named;
+import jakarta.enterprise.context.RequestScoped;
+import jakarta.faces.component.UIComponent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ *
+ * @author caleb
+ */
+@Named(value="registration")
+@RequestScoped
+public class Registration {
+
+ UIComponent c;
+
+ private String lastName;
+ private String firstName;
+ private String mi;
+ private String gender;
+ private String major;
+ private List minor;
+ private Set remarks;
+ private List hobby;
+
+ public Registration() {
+ minor = new ArrayList();
+ minor.add("CS");
+ minor.add("Math");
+ minor.add("Engineering");
+ }
+
+ public UIComponent getC()
+ {
+ return c;
+ }
+
+ public void setC(UIComponent c)
+ {
+ this.c = c;
+ }
+
+ /**
+ * Get the value of hobby
+ *
+ * @return the value of hobby
+ */
+ public List getHobby()
+ {
+ return hobby;
+ }
+
+ /**
+ * Set the value of hobby
+ *
+ * @param hobby new value of hobby
+ */
+ public void setHobby(List hobby)
+ {
+ this.hobby = hobby;
+ }
+
+
+ public Set getRemarks()
+ {
+ return remarks;
+ }
+
+ public void setRemarks(Set remarks)
+ {
+ this.remarks = remarks;
+ }
+
+
+ /**
+ * Get the value of minor
+ *
+ * @return the value of minor
+ */
+ public List getMinor()
+ {
+ return minor;
+ }
+
+ /**
+ * Set the value of minor
+ *
+ * @param minor new value of minor
+ */
+ public void setMinor(List minor)
+ {
+ this.minor = minor;
+ }
+
+
+ public String getMajor()
+ {
+ return major;
+ }
+
+ public void setMajor(String major)
+ {
+ this.major = major;
+ }
+
+
+ /**
+ * Get the value of gender
+ *
+ * @return the value of gender
+ */
+ public String getGender()
+ {
+ return gender;
+ }
+
+ /**
+ * Set the value of gender
+ *
+ * @param gender new value of gender
+ */
+ public void setGender(String gender)
+ {
+ this.gender = gender;
+ }
+
+
+ public String getMi()
+ {
+ return mi;
+ }
+
+ public void setMi(String mi)
+ {
+ this.mi = mi;
+ }
+
+
+ /**
+ * Get the value of firstName
+ *
+ * @return the value of firstName
+ */
+ public String getFirstName()
+ {
+ return firstName;
+ }
+
+ /**
+ * Set the value of firstName
+ *
+ * @param firstName new value of firstName
+ */
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+
+ public String getLastName()
+ {
+ return lastName;
+ }
+
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+ public String getResponse()
+ {
+ if (lastName == null) {
+ return ""; // Request has not been made
+ } else {
+ String allMinor = "";
+ for (String s : minor) {
+ allMinor += s + " ";
+ }
+
+ String allHobby = "";
+ for (String s : hobby) {
+ allHobby += s + " ";
+ }
+
+ return "You entered
"
+ + "Last Name: " + lastName + "
"
+ + "First Name: " + firstName + "
"
+ + "MI: " + mi + "
"
+ + "Gender: " + gender + "
"
+ + "Major: " + major + "
"
+ + "Minor: " + allMinor + "
"
+ + "Hobby: " + allHobby + "
"
+ + "Remarks: " + remarks + "
";
+ }
+ }
+}
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/edu/slcc/asdv/caleb/multicomponents_lab_calebfontenot/JakartaRestConfiguration.java b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/edu/slcc/asdv/caleb/multicomponents_lab_calebfontenot/JakartaRestConfiguration.java
new file mode 100644
index 0000000..6f16197
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/edu/slcc/asdv/caleb/multicomponents_lab_calebfontenot/JakartaRestConfiguration.java
@@ -0,0 +1,13 @@
+package edu.slcc.asdv.caleb.multicomponents_lab_calebfontenot;
+
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
+
+/**
+ * Configures Jakarta RESTful Web Services for the application.
+ * @author Juneau
+ */
+@ApplicationPath("resources")
+public class JakartaRestConfiguration extends Application {
+
+}
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/edu/slcc/asdv/caleb/multicomponents_lab_calebfontenot/resources/JakartaEE10Resource.java b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/edu/slcc/asdv/caleb/multicomponents_lab_calebfontenot/resources/JakartaEE10Resource.java
new file mode 100644
index 0000000..5b62279
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/java/edu/slcc/asdv/caleb/multicomponents_lab_calebfontenot/resources/JakartaEE10Resource.java
@@ -0,0 +1,20 @@
+package edu.slcc.asdv.caleb.multicomponents_lab_calebfontenot.resources;
+
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.core.Response;
+
+/**
+ *
+ * @author
+ */
+@Path("jakartaee10")
+public class JakartaEE10Resource {
+
+ @GET
+ public Response ping(){
+ return Response
+ .ok("ping Jakarta EE")
+ .build();
+ }
+}
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/resources/META-INF/persistence.xml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..7582bf1
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/beans.xml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..9dfae34
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/glassfish-web.xml
new file mode 100644
index 0000000..673cc06
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/glassfish-web.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+ Keep a copy of the generated servlet class' java code.
+
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/web.xml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..fcfcd54
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+
+
+
+ jakarta.faces.PROJECT_STAGE
+ Development
+
+
+ Faces Servlet
+ jakarta.faces.webapp.FacesServlet
+ 1
+
+
+ Faces Servlet
+ /faces/*
+
+
+
+ 30
+
+
+
+ faces/index.xhtml
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/index.html b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/index.html
new file mode 100644
index 0000000..3368e9c
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/index.html
@@ -0,0 +1,10 @@
+
+
+
+ Start Page
+
+
+
+ Hello World!
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/index.xhtml b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/index.xhtml
new file mode 100644
index 0000000..71f0d5e
--- /dev/null
+++ b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/index.xhtml
@@ -0,0 +1,78 @@
+
+
+
+
+ Facelet Title
+
+
+
+
+ Student Registration Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gender
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Remarks:
+
+
+
+
+
+
+
+
+
diff --git a/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/resources/us.gif b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/resources/us.gif
new file mode 100644
index 0000000..2523dfc
Binary files /dev/null and b/Semester 2/edu.slcc.asdv.caleb_Multicomponents2_Lab_CalebFontenot_war_1.0-SNAPSHOT/src/main/webapp/resources/us.gif differ