diff --git a/pom.xml b/pom.xml
index d9f38fa..ca9f27f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,38 +45,38 @@
-
-
-
- org.apache.tomcat.maven
- tomcat7-maven-plugin
- 2.2
-
- https://tomcat.joethei.space/manager/text
- TomcatServer
- /itech
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
- 3.1.0
-
- false
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.1
-
-
- ${java.version}
-
-
-
-
+
+
+ org.apache.tomcat.maven
+ tomcat7-maven-plugin
+ 2.2
+
+ https://tomcat.joethei.space/manager/text
+ TomcatServer
+ /itech
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 3.1.0
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+
+ ${java.version}
+
+
+
+
+
diff --git a/src/main/java/de/hsel/itech/jsf/CategoryBean.java b/src/main/java/de/hsel/itech/jsf/CategoryBean.java
index d97c985..7c9d444 100644
--- a/src/main/java/de/hsel/itech/jsf/CategoryBean.java
+++ b/src/main/java/de/hsel/itech/jsf/CategoryBean.java
@@ -1,29 +1,34 @@
package de.hsel.itech.jsf;
import de.hsel.itech.db.Database;
+import de.hsel.itech.db.pojo.Book;
import de.hsel.itech.db.pojo.Category;
-import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
import java.io.Serializable;
import java.util.List;
@ManagedBean
-@ApplicationScoped
+@ViewScoped
public class CategoryBean implements Serializable {
- private String hello = "Hallo Welt";
+ private Category category;
+
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(Category category) {
+ this.category = category;
- public String getHello() {
- return hello;
}
public List getCategories() {
return Database.getInstance().getCategories();
}
- public String test() {
- return "";
+ public List getBooks() {
+ return Database.getInstance().getBooks(category);
}
-
}
\ No newline at end of file
diff --git a/src/main/webapp/category.xhtml b/src/main/webapp/category.xhtml
index 2fe7543..d63cde7 100644
--- a/src/main/webapp/category.xhtml
+++ b/src/main/webapp/category.xhtml
@@ -6,15 +6,24 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
-Amazon light
+ Amazon light
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+