that's it for today
This commit is contained in:
@@ -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