summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/pages/categories.xhtml2
-rw-r--r--WebContent/pages/category.xhtml2
-rw-r--r--WebContent/pages/contact.xhtml2
-rw-r--r--WebContent/pages/greeting.xhtml2
-rw-r--r--WebContent/pages/home.xhtml2
-rw-r--r--WebContent/pages/login.xhtml2
-rw-r--r--WebContent/pages/product.xhtml2
-rw-r--r--WebContent/pages/products.xhtml2
-rw-r--r--src/beans/UserManager.java4
9 files changed, 10 insertions, 10 deletions
diff --git a/WebContent/pages/categories.xhtml b/WebContent/pages/categories.xhtml
index 24587fc..2e8cd0e 100644
--- a/WebContent/pages/categories.xhtml
+++ b/WebContent/pages/categories.xhtml
@@ -6,7 +6,7 @@
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
- <ui:composition template="/templates/common.xhtml">
+ <ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Application</ui:define>
diff --git a/WebContent/pages/category.xhtml b/WebContent/pages/category.xhtml
index 3147efc..4a5ea10 100644
--- a/WebContent/pages/category.xhtml
+++ b/WebContent/pages/category.xhtml
@@ -6,7 +6,7 @@
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
- <ui:composition template="/templates/common.xhtml">
+ <ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Application</ui:define>
diff --git a/WebContent/pages/contact.xhtml b/WebContent/pages/contact.xhtml
index 891aeed..418669e 100644
--- a/WebContent/pages/contact.xhtml
+++ b/WebContent/pages/contact.xhtml
@@ -6,7 +6,7 @@
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
- <ui:composition template="/templates/common.xhtml">
+ <ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Application</ui:define>
diff --git a/WebContent/pages/greeting.xhtml b/WebContent/pages/greeting.xhtml
index cbeb5d0..ce3ec7f 100644
--- a/WebContent/pages/greeting.xhtml
+++ b/WebContent/pages/greeting.xhtml
@@ -5,7 +5,7 @@
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
- <ui:composition template="/templates/loggedin.xhtml">
+ <ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Welcome</ui:define>
diff --git a/WebContent/pages/home.xhtml b/WebContent/pages/home.xhtml
index c54e7dd..5e2cb12 100644
--- a/WebContent/pages/home.xhtml
+++ b/WebContent/pages/home.xhtml
@@ -9,7 +9,7 @@
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
</head>
- <ui:composition template="/templates/common.xhtml">
+ <ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Application</ui:define>
diff --git a/WebContent/pages/login.xhtml b/WebContent/pages/login.xhtml
index 87d425c..e1eaa6d 100644
--- a/WebContent/pages/login.xhtml
+++ b/WebContent/pages/login.xhtml
@@ -6,7 +6,7 @@
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
-<ui:composition template="/templates/common.xhtml">
+<ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Login</ui:define>
diff --git a/WebContent/pages/product.xhtml b/WebContent/pages/product.xhtml
index 8859026..84b49f6 100644
--- a/WebContent/pages/product.xhtml
+++ b/WebContent/pages/product.xhtml
@@ -6,7 +6,7 @@
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
-<ui:composition template="/templates/common.xhtml">
+<ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Application</ui:define>
diff --git a/WebContent/pages/products.xhtml b/WebContent/pages/products.xhtml
index 1fb7f95..1b5e5e4 100644
--- a/WebContent/pages/products.xhtml
+++ b/WebContent/pages/products.xhtml
@@ -6,7 +6,7 @@
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
- <ui:composition template="/templates/common.xhtml">
+ <ui:composition template="#{UserManager.loggedIn ? '/templates/loggedin.xhtml' : '/templates/common.xhtml'}">
<ui:define name="pageTitle">JCatalog Application</ui:define>
diff --git a/src/beans/UserManager.java b/src/beans/UserManager.java
index 36fd807..3f38be6 100644
--- a/src/beans/UserManager.java
+++ b/src/beans/UserManager.java
@@ -37,7 +37,7 @@ public class UserManager
public String login()
{
- String outcome = "failure";
+ String outcome = "login";
if (current.getUsername() != null && current.getUsername().length() > 0
&& current.getPassword() != null
&& current.getPassword().length() > 0)
@@ -54,7 +54,7 @@ public class UserManager
{
loggedIn = true;
current = (User) results.get(0);
- outcome = "success";
+ outcome = "greeting";
}
manager.close();