that's it for today
This commit is contained in:
		@@ -0,0 +1,67 @@
 | 
			
		||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<title>LanguageBean.java</title>
 | 
			
		||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 | 
			
		||||
<style type="text/css">
 | 
			
		||||
<!--
 | 
			
		||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
 | 
			
		||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
 | 
			
		||||
table {color: #888888; background-color: #313335; font-family: monospace}
 | 
			
		||||
.ST2 {color: #9876aa}
 | 
			
		||||
.ST3 {color: #ffc66d}
 | 
			
		||||
.string {color: #6a8759}
 | 
			
		||||
.comment {color: #808080}
 | 
			
		||||
.whitespace {color: #505050}
 | 
			
		||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
 | 
			
		||||
.ST0 {color: #287bde}
 | 
			
		||||
.literal {color: #cc7832}
 | 
			
		||||
-->
 | 
			
		||||
</style>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<table width="100%"><tr><td align="center">/home/caleb/ASDV-WebDev/Semester 2/Assignments/lab1-CalebFontenot/src/main/java/edu/slcc/asdv/LanguageBean.java</td></tr></table>
 | 
			
		||||
<pre>
 | 
			
		||||
<span class="comment">/*</span>
 | 
			
		||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
 | 
			
		||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
 | 
			
		||||
<span class="comment"> */</span>
 | 
			
		||||
<span class="literal">package</span> edu.slcc.asdv;
 | 
			
		||||
 | 
			
		||||
<span class="literal">import</span> jakarta.inject.Named;
 | 
			
		||||
<span class="literal">import</span> jakarta.enterprise.context.RequestScoped;
 | 
			
		||||
 | 
			
		||||
<span class="comment">/**</span>
 | 
			
		||||
<span class="comment"> *</span>
 | 
			
		||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
 | 
			
		||||
 <span class="comment">*/</span>
 | 
			
		||||
@Named(value = <span class="string">"</span><span class="string">languageBean</span><span class="string">"</span>)
 | 
			
		||||
@RequestScoped
 | 
			
		||||
<span class="literal">public</span> <span class="literal">class</span> LanguageBean {
 | 
			
		||||
 | 
			
		||||
    <span class="literal">private</span> String <span class="ST2">language</span>;
 | 
			
		||||
 | 
			
		||||
    <span class="literal">public</span> String <span class="ST3">getLanguage</span>() {
 | 
			
		||||
        <span class="literal">return</span> <span class="ST2">language</span>;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    <span class="literal">public</span> <span class="literal">void</span> <span class="ST3">setLanguage</span>(String language) {
 | 
			
		||||
        <span class="literal">this</span>.<span class="ST2">language</span> = language.trim();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    <span class="literal">public</span> String <span class="ST3">showChoice</span>() {
 | 
			
		||||
        <span class="literal">if</span> (<span class="ST2">language</span>.equalsIgnoreCase(<span class="string">"</span><span class="string">Java</span><span class="string">"</span>) || <span class="ST2">language</span>.equalsIgnoreCase(<span class="string">"</span><span class="string">Groovy</span><span class="string">"</span>)) {
 | 
			
		||||
            <span class="literal">return</span> (<span class="string">"</span><span class="string">goodLanguage</span><span class="string">"</span>);
 | 
			
		||||
        } <span class="literal">else</span> <span class="literal">if</span> (isMissing(<span class="ST2">l</span><span class="ST2">anguage</span>)) {
 | 
			
		||||
            <span class="literal">return</span> (<span class="string">"</span><span class="string">MissingLanguage</span><span class="string">"</span>);
 | 
			
		||||
        } <span class="literal">else</span> {
 | 
			
		||||
            <span class="literal">return</span> (<span class="string">"</span><span class="string">badLanguage</span><span class="string">"</span>);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    <span class="literal">private</span> <span class="literal">boolean</span> <span class="ST3">isMissing</span>(String value) {
 | 
			
		||||
        <span class="literal">return</span> ((value == <span class="literal">null</span>) || (value.trim().isEmpty()));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</pre></body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -0,0 +1,53 @@
 | 
			
		||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<title>index.xhtml</title>
 | 
			
		||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 | 
			
		||||
<style type="text/css">
 | 
			
		||||
<!--
 | 
			
		||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
 | 
			
		||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
 | 
			
		||||
table {color: #888888; background-color: #313335; font-family: monospace}
 | 
			
		||||
.ST3 {color: #e8bf6a}
 | 
			
		||||
.ST6 {color: #e8bf6a; font-family: monospace; font-weight: bold}
 | 
			
		||||
.ST1 {color: #505050}
 | 
			
		||||
.ST4 {color: #bababa}
 | 
			
		||||
.ST2 {color: #287bde}
 | 
			
		||||
.ST0 {color: #628fb5}
 | 
			
		||||
.ST5 {color: #a5c261}
 | 
			
		||||
.expression-language {background-color: #232525}
 | 
			
		||||
.highlight-caret-row {background-color: #323232}
 | 
			
		||||
-->
 | 
			
		||||
</style>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<table width="100%"><tr><td align="center">/home/caleb/ASDV-WebDev/Semester 2/Assignments/lab1-CalebFontenot/src/main/webapp/index.xhtml</td></tr></table>
 | 
			
		||||
<pre>
 | 
			
		||||
<span class="highlight-caret-row"><?xml version='1.0' encoding='UTF-8' ?></span>
 | 
			
		||||
<span class="ST0"><!DOCTYPE</span> <span class="ST0">html</span> <span class="ST0">PUBLIC</span> <span class="ST0">"-//W3C//DTD</span> <span class="ST0">XHTML</span> <span class="ST0">1.0</span> <span class="ST0">Transitional//EN"</span> <span class="ST0">"</span><span class="ST2">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</span><span class="ST0">"</span><span class="ST0">></span>
 | 
			
		||||
<span class="ST3"><</span><span class="ST3">html</span> <span class="ST4">xmlns</span><span class="ST4">=</span><span class="ST5">"</span><span class="ST2">http://www.w3.org/1999/xhtml</span><span class="ST5">"</span>
 | 
			
		||||
      <span class="ST4">xmlns:h</span><span class="ST4">=</span><span class="ST5">"</span><span class="ST2">http://xmlns.jcp.org/jsf/html</span><span class="ST5">"</span><span class="ST3">></span>
 | 
			
		||||
    <span class="ST6"><</span><span class="ST6">h:head</span><span class="ST6">></span>
 | 
			
		||||
        <span class="ST3"><</span><span class="ST3">title</span><span class="ST3">></span>Facelet Title<span class="ST3"></</span><span class="ST3">title</span><span class="ST3">></span>
 | 
			
		||||
    <span class="ST6"></</span><span class="ST6">h:head</span><span class="ST6">></span>
 | 
			
		||||
    <span class="ST6"><</span><span class="ST6">h:form</span><span class="ST6">></span>
 | 
			
		||||
        Enter a programming language and I will tell you if it 
 | 
			
		||||
        can be used to implement the JSF managed beans:<span class="ST3"><</span><span class="ST3">br</span><span class="ST3">/></span>
 | 
			
		||||
        <span class="ST6"><</span><span class="ST6">h:inputText</span> <span class="ST4">value</span><span class="ST4">=</span><span class="ST5">"</span><span class="expression-language">#{</span><span class="expression-language">languageBean</span><span class="expression-language">.</span><span class="expression-language">language</span><span class="expression-language">}</span><span class="ST5">"</span><span class="ST3">/</span><span class="ST6">></span><span class="ST3"><</span><span class="ST3">br</span><span class="ST3">/></span>
 | 
			
		||||
        <span class="ST6"><</span><span class="ST6">h:commandButton</span> <span class="ST4">value</span><span class="ST4">=</span><span class="ST5">"Check Language"</span>
 | 
			
		||||
                         <span class="ST4">action</span><span class="ST4">=</span><span class="ST5">"</span><span class="expression-language">#{</span><span class="expression-language">languageBean</span><span class="expression-language">.</span><span class="expression-language">showChoice</span><span class="expression-language">}</span><span class="ST5">"</span><span class="ST3">/</span><span class="ST6">></span>
 | 
			
		||||
        
 | 
			
		||||
    <span class="ST6"></</span><span class="ST6">h:form</span><span class="ST6">></span>
 | 
			
		||||
    <span class="ST6"><</span><span class="ST6">h:body</span><span class="ST6">></span>
 | 
			
		||||
        <span class="ST6"><</span><span class="ST6">h:form</span><span class="ST6">></span>
 | 
			
		||||
            Press button to get to one of three possible results pages.
 | 
			
		||||
            <span class="ST3"><</span><span class="ST3">br</span><span class="ST3">/></span>
 | 
			
		||||
            <span class="ST6"><</span><span class="ST6">h:commandButton</span> <span class="ST4">value</span><span class="ST4">=</span><span class="ST5">"Go to Random Page"</span>
 | 
			
		||||
                             <span class="ST4">action</span><span class="ST4">=</span><span class="ST5">"</span><span class="expression-language">#{</span><span class="expression-language">navigator</span><span class="expression-language">.</span><span class="expression-language">choosePage</span><span class="expression-language">}</span><span class="ST5">"</span><span class="ST3">/</span><span class="ST6">></span>
 | 
			
		||||
        <span class="ST6"></</span><span class="ST6">h:form</span><span class="ST6">></span>
 | 
			
		||||
    <span class="ST6"></</span><span class="ST6">h:body</span><span class="ST6">></span>
 | 
			
		||||
    
 | 
			
		||||
<span class="ST3"></</span><span class="ST3">html</span><span class="ST3">></span>
 | 
			
		||||
 | 
			
		||||
</pre></body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -14,8 +14,7 @@ That way multiple projects can share the same settings (useful for formatting ru
 | 
			
		||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
 | 
			
		||||
-->
 | 
			
		||||
        <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>10-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
 | 
			
		||||
        <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv700ee10</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
 | 
			
		||||
        <org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language>
 | 
			
		||||
        <netbeans.hint.jdkPlatform>JDK_11__System_</netbeans.hint.jdkPlatform>
 | 
			
		||||
        <netbeans.hint.jdkPlatform>JDK_15</netbeans.hint.jdkPlatform>
 | 
			
		||||
    </properties>
 | 
			
		||||
</project-shared-configuration>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
    <name>lab1-CalebFontenot-1.0-SNAPSHOT</name>
 | 
			
		||||
    
 | 
			
		||||
    <properties>
 | 
			
		||||
        <maven.compiler.source>11</maven.compiler.source>
 | 
			
		||||
        <maven.compiler.target>11</maven.compiler.target>
 | 
			
		||||
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
 | 
			
		||||
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
        <failOnMissingWebXml>false</failOnMissingWebXml>
 | 
			
		||||
@@ -32,8 +30,8 @@
 | 
			
		||||
                <artifactId>maven-compiler-plugin</artifactId>
 | 
			
		||||
                <version>3.8.1</version>
 | 
			
		||||
                <configuration>
 | 
			
		||||
                    <source>11</source>
 | 
			
		||||
                    <target>11</target>
 | 
			
		||||
                    <source>15</source>
 | 
			
		||||
                    <target>15</target>
 | 
			
		||||
                    <compilerArguments>
 | 
			
		||||
                        <endorseddirs>${endorsed.dir}</endorseddirs>
 | 
			
		||||
                    </compilerArguments>
 | 
			
		||||
 
 | 
			
		||||
@@ -4,18 +4,26 @@
 | 
			
		||||
 */
 | 
			
		||||
package edu.slcc.asdv;
 | 
			
		||||
 | 
			
		||||
import edu.slcc.asdv.bl.DataFromDatabase;
 | 
			
		||||
import jakarta.inject.Named;
 | 
			
		||||
import jakarta.enterprise.context.RequestScoped;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author caleb
 | 
			
		||||
 */
 | 
			
		||||
public class SomeBean {
 | 
			
		||||
 | 
			
		||||
    private String someProperty;
 | 
			
		||||
private DataFromDatabase data; // a placeholder for our business logic
 | 
			
		||||
    private String someProperty = "This is  the initialized property.";
 | 
			
		||||
    
 | 
			
		||||
    public SomeBean() {
 | 
			
		||||
        data = new DataFromDatabase();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    public List<String> getDataFromDatabase() {
 | 
			
		||||
        return data.getList();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public String getSomeProperty() {
 | 
			
		||||
@@ -27,6 +35,8 @@ public class SomeBean {
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public String actionControllerMethod() {
 | 
			
		||||
        System.out.println("actionController() called");
 | 
			
		||||
        System.out.println(this.someProperty);
 | 
			
		||||
        return "something";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,47 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author caleb
 | 
			
		||||
 */
 | 
			
		||||
public class DataFromDatabase {
 | 
			
		||||
    
 | 
			
		||||
    private List<String> list = new ArrayList();
 | 
			
		||||
    public DataFromDatabase() {
 | 
			
		||||
        //this info could have come from a database.
 | 
			
		||||
        list.add("Sunday");
 | 
			
		||||
        list.add("Monday");
 | 
			
		||||
        list.add("Tuesday");
 | 
			
		||||
        list.add("Wednesday");
 | 
			
		||||
        list.add("Thursday");
 | 
			
		||||
        list.add("Friday");
 | 
			
		||||
        list.add("Saturday");
 | 
			
		||||
    }
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the value of list
 | 
			
		||||
     *
 | 
			
		||||
     * @return the value of list
 | 
			
		||||
     */
 | 
			
		||||
    public List<String> getList()
 | 
			
		||||
    {
 | 
			
		||||
        return list;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Set the value of list
 | 
			
		||||
     *
 | 
			
		||||
     * @param list new value of list
 | 
			
		||||
     */
 | 
			
		||||
    public void setList(List<String> list)
 | 
			
		||||
    {
 | 
			
		||||
        this.list = list;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -6,6 +6,7 @@
 | 
			
		||||
        <title>Facelet Title</title>
 | 
			
		||||
    </h:head>
 | 
			
		||||
    <h:form>
 | 
			
		||||
        #{someBean.getDataFromDatabase()}
 | 
			
		||||
        Enter a programming language and I will tell you if it 
 | 
			
		||||
        can be used to implement the JSF managed beans:<br/>
 | 
			
		||||
        <h:inputText value="#{languageBean.language}"/><br/>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user