Author: shane.bryzak(a)jboss.com
Date: 2010-03-29 05:08:48 -0400 (Mon, 29 Mar 2010)
New Revision: 12308
Added:
modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
modules/security/trunk/examples/seamspace/src/main/webapp/test.xhtml
Modified:
modules/security/trunk/examples/seamspace/pom.xml
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/web.xml
modules/security/trunk/examples/seamspace/src/main/webapp/home.xhtml
modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml
Log:
faces-config.xml is required after all, otherwise jsf pages won't render
Modified: modules/security/trunk/examples/seamspace/pom.xml
===================================================================
--- modules/security/trunk/examples/seamspace/pom.xml 2010-03-29 07:34:38 UTC (rev 12307)
+++ modules/security/trunk/examples/seamspace/pom.xml 2010-03-29 09:08:48 UTC (rev 12308)
@@ -30,6 +30,20 @@
</dependency>
<dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.2-FCS</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.seam.security</groupId>
<artifactId>seam-security-core</artifactId>
<version>3.0.0-SNAPSHOT</version>
@@ -61,14 +75,21 @@
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>runtime</scope>
+ <version>2.1.2-b04</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>2.0.2-FCS</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
<build>
Added:
modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
===================================================================
---
modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
(rev 0)
+++
modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java 2010-03-29
09:08:48 UTC (rev 12308)
@@ -0,0 +1,18 @@
+package org.jboss.seam.security.examples.seamspace.util;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+
+@ConversationScoped
+public class EntityManagerProducer implements Serializable
+{
+ private static final long serialVersionUID = 8654896806568473010L;
+
+ public @Produces EntityManager getEntityManager()
+ {
+ return null;
+ }
+}
Modified:
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml 2010-03-29
07:34:38 UTC (rev 12307)
+++
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml 2010-03-29
09:08:48 UTC (rev 12308)
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="1.2"
-
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+<!-- This file is not required if you don't need any extra configuration. -->
+<faces-config version="2.0"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+ <!-- Write your navigation rules here. You are encouraged to use CDI for creating
@Named managed beans. -->
+
</faces-config>
Modified: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/web.xml 2010-03-29
07:34:38 UTC (rev 12307)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/web.xml 2010-03-29
09:08:48 UTC (rev 12308)
@@ -2,7 +2,8 @@
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>SeamSpace Example</display-name>
@@ -19,14 +20,9 @@
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
-
<!-- Content Servlet -->
- <servlet>
+ <!--servlet>
<servlet-name>Content Servlet</servlet-name>
<servlet-class>org.jboss.seam.security.examples.seamspace.util.ContentServlet</servlet-class>
</servlet>
@@ -34,9 +30,6 @@
<servlet-mapping>
<servlet-name>Content Servlet</servlet-name>
<url-pattern>/content/*</url-pattern>
- </servlet-mapping>
+ </servlet-mapping-->
- <session-config>
- <session-timeout>10</session-timeout>
- </session-config>
</web-app>
Modified: modules/security/trunk/examples/seamspace/src/main/webapp/home.xhtml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/home.xhtml 2010-03-29
07:34:38 UTC (rev 12307)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/home.xhtml 2010-03-29
09:08:48 UTC (rev 12308)
@@ -1,93 +1,95 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
- template="/template.xhtml">
-
- <ui:define name="content">
- <div id="contentMain">
- <h1>Welcome to seamspace!</h1>
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:composition template="/template.xhtml">
- <p>
- This example project is an imitation of a popular social networking site, and
has
- been put together to demonstrate the various features of the Seam Security API.
- </p>
-
- <p><b>New!</b> You can now use the <h:link
view="/hashgen.xhtml" value="Password Hash Generator"/>
- page to generate password hashes for your own application.
- </p>
-
- </div>
-
- <div id="contentDivider">
- </div>
-
- <div id="contentSide">
- <div class="advertising"></div>
-
- <h:form id="loginForm" rendered="#{not
identity.loggedIn}">
- <div class="memberLogin">
- <div class="loginHeader">Member Login</div>
+ <ui:define name="content">
+ <div id="contentMain">
+ <h1>Welcome to seamspace!</h1>
+
+ <p>
+ This example project is an imitation of a popular social networking site, and
has
+ been put together to demonstrate the various features of the Seam Security
API.
+ </p>
+
+ <p><b>New!</b> You can now use the <h:link
view="/hashgen.xhtml" value="Password Hash Generator"/>
+ page to generate password hashes for your own application.
+ </p>
+
+ </div>
+
+ <div id="contentDivider">
+ </div>
+
+ <div id="contentSide">
+ <div class="advertising"></div>
+
+ <h:form id="loginForm" rendered="#{not
identity.loggedIn}">
+ <div class="memberLogin">
+ <div class="loginHeader">Member Login</div>
+
+ <h:messages id="messages" globalOnly="true"/>
+
+ <div class="loginRow">
+ <h:outputLabel for="name" value="Member name"
styleClass="loginLabel"/>
+ <h:inputText id="name"
value="#{credentials.username}"/>
+ </div>
+
+ <div class="validationMsg">
+ <h:message for="name"/>
+ </div>
+
+ <div class="loginRow">
+ <h:outputLabel for="password" value="Password"
styleClass="loginLabel"/>
+ <h:inputSecret id="password"
value="#{credentials.password}" redisplay="true"/>
+ </div>
+
+ <div class="validationMsg">
+ <h:message for="password"/>
+ </div>
+
+ <div class="loginRow">
+ <h:outputLabel for="rememberMe" value="Remember me"
styleClass="loginLabel"/>
+ <h:selectBooleanCheckbox id="rememberMe"
value="#{identity.rememberMe}"/>
+ </div>
+
+ <div class="buttons">
+ <h:commandButton id="login" value="LOGIN"
action="#{identity.login}" styleClass="loginButton"/>
+ <h:commandButton id="register" value="SIGN UP!"
action="#{register.start}" styleClass="registerButton"/>
+ </div>
+
+ <br class="clear"/>
- <h:messages id="messages" globalOnly="true"/>
-
- <div class="loginRow">
- <h:outputLabel for="name" value="Member name"
styleClass="loginLabel"/>
- <h:inputText id="name"
value="#{credentials.username}"/>
</div>
- <div class="validationMsg">
- <h:message for="name"/>
- </div>
+ <span>Tip: You can log in using <b>demo/demo</b> as the
username/password</span>
+ </h:form>
+
+ <div class="newMembers">
+ <div class="newMembersHeader">Cool new members</div>
+
+ <ui:repeat value="#{newMembers}" var="newMember">
+ <div class="newMember">
+
+ <h:link view="/profile.seam" propagation="none">
+ <f:param name="name"
value="#{newMember.memberName}"/>
+ #{newMember.memberName}<br/>
+ <h:graphicImage
value="/content/images?id=#{newMember.picture.imageId}&width=90"/>
+ </h:link>
+
+ </div>
+ </ui:repeat>
- <div class="loginRow">
- <h:outputLabel for="password" value="Password"
styleClass="loginLabel"/>
- <h:inputSecret id="password"
value="#{credentials.password}" redisplay="true"/>
- </div>
-
- <div class="validationMsg">
- <h:message for="password"/>
- </div>
-
- <div class="loginRow">
- <h:outputLabel for="rememberMe" value="Remember me"
styleClass="loginLabel"/>
- <h:selectBooleanCheckbox id="rememberMe"
value="#{identity.rememberMe}"/>
- </div>
-
- <div class="buttons">
- <h:commandButton id="login" value="LOGIN"
action="#{identity.login}" styleClass="loginButton"/>
- <h:commandButton id="register" value="SIGN UP!"
action="#{register.start}" styleClass="registerButton"/>
- </div>
-
<br class="clear"/>
-
</div>
-
- <span>Tip: You can log in using <b>demo/demo</b> as the
username/password</span>
- </h:form>
-
- <div class="newMembers">
- <div class="newMembersHeader">Cool new members</div>
-
- <ui:repeat value="#{newMembers}" var="newMember">
- <div class="newMember">
-
- <h:link view="/profile.seam" propagation="none">
- <f:param name="name"
value="#{newMember.memberName}"/>
- #{newMember.memberName}<br/>
- <h:graphicImage
value="/content/images?id=#{newMember.picture.imageId}&width=90"/>
- </h:link>
-
- </div>
- </ui:repeat>
-
- <br class="clear"/>
</div>
- </div>
-
- </ui:define>
-
-</ui:composition>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml 2010-03-29
07:34:38 UTC (rev 12307)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml 2010-03-29
09:08:48 UTC (rev 12308)
@@ -1,66 +1,65 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
-<head>
- <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
- <title>SeamSpace</title>
- <link href="style/seamspace.css" rel="stylesheet"
type="text/css"/>
- <link href="style/date.css" rel="stylesheet"
type="text/css"/>
- <ui:insert name="head"/>
-</head>
-
-<body>
-
- <div id="header">
- <div class="headerRight">
- <div class="headerMenu">
-
- <s:fragment rendered="#{identity.loggedIn}">
- <s:link id="profile" view="/profile.xhtml"
value="My Profile" propagation="none">
- <f:param name="name"
value="#{authenticatedMember.memberName}"/>
- </s:link>
- <h:outputText styleClass="divider" value=" | "/>
- </s:fragment>
-
- <s:fragment rendered="#{s:hasRole('admin')}">
- <s:link id="security" view="/security.xhtml"
value="Security" propagation="none"/>
- <h:outputText styleClass="divider" value=" | "/>
- </s:fragment>
-
- <s:link id="logout" action="#{identity.logout}"
value="Log out" rendered="#{identity.loggedIn}"/>
- <h:outputLink id="login" value="home.seam"
rendered="#{not identity.loggedIn}">Log in</h:outputLink>
- </div>
- <br style="clear:both"/>
- <h:form>
- <div>
- <a href="#">SeamSpace</a><h:outputText
styleClass="divider" value=" | "/>
- <a href="#">People</a><h:outputText
styleClass="divider" value=" | "/>
- <a href="#">Music</a><h:outputText
styleClass="divider" value=" | "/>
- <a href="#">Blogs</a>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>SeamSpace</title>
+ <link href="style/seamspace.css" rel="stylesheet"
type="text/css"/>
+ <link href="style/date.css" rel="stylesheet"
type="text/css"/>
+ <ui:insert name="head"/>
+ </head>
+
+ <body>
+
+ <div id="header">
+ <div class="headerRight">
+ <div class="headerMenu">
+
+ <ui:fragment rendered="#{identity.loggedIn}">
+ <s:link id="profile" view="/profile.xhtml"
value="My Profile" propagation="none">
+ <f:param name="name"
value="#{authenticatedMember.memberName}"/>
+ </s:link>
+ <h:outputText styleClass="divider" value=" | "/>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{s:hasRole('admin')}">
+ <s:link id="security" view="/security.xhtml"
value="Security" propagation="none"/>
+ <h:outputText styleClass="divider" value=" | "/>
+ </ui:fragment>
+
+ <h:link id="logout" action="#{identity.logout}"
value="Log out" rendered="#{identity.loggedIn}"/>
+ <h:outputLink id="login" value="home.seam"
rendered="#{not identity.loggedIn}">Log in</h:outputLink>
</div>
- <div id="search">
- <h:inputText type="text" styleClass="searchField"/>
- <h:commandButton value="Search SeamSpace"
onclick="javascript:alert('This feature coming soon!');return false"
styleClass="searchButton"/>
- </div>
- </h:form>
+ <br style="clear:both"/>
+ <h:form>
+ <div>
+ <a href="#">SeamSpace</a><h:outputText
styleClass="divider" value=" | "/>
+ <a href="#">People</a><h:outputText
styleClass="divider" value=" | "/>
+ <a href="#">Music</a><h:outputText
styleClass="divider" value=" | "/>
+ <a href="#">Blogs</a>
+ </div>
+ <div id="search">
+ <h:inputText type="text"
styleClass="searchField"/>
+ <h:commandButton value="Search SeamSpace"
onclick="javascript:alert('This feature coming soon!');return false"
styleClass="searchButton"/>
+ </div>
+ </h:form>
+ </div>
</div>
- </div>
+
+ <div id="menubar">
+ <h:link view="/home.xhtml" value="Home"
propagation="none"/><h:outputText styleClass="divider"
value=" | "/>
+ <h:link value="Browse" onclick="javascript:alert('This
feature coming soon!');return false"/><h:outputText
styleClass="divider" value=" | "/>
+ <h:link value="Blog" onclick="javascript:alert('This feature
coming soon!');return false"/><h:outputText styleClass="divider"
value=" | "/>
+ <h:link value="Music" onclick="javascript:alert('This feature
coming soon!');return false"/>
+ </div>
- <div id="menubar">
- <s:link view="/home.xhtml" value="Home"
propagation="none"/><h:outputText styleClass="divider"
value=" | "/>
- <s:link value="Browse" onclick="javascript:alert('This feature
coming soon!');return false"/><h:outputText styleClass="divider"
value=" | "/>
- <s:link value="Blog" onclick="javascript:alert('This feature
coming soon!');return false"/><h:outputText styleClass="divider"
value=" | "/>
- <s:link value="Music" onclick="javascript:alert('This feature
coming soon!');return false"/>
- </div>
-
- <div id="content">
- <ui:insert name="content"/>
- </div>
-
-</body>
+ <div id="content">
+ <ui:insert name="content"/>
+ </div>
+
+ </body>
</html>
Added: modules/security/trunk/examples/seamspace/src/main/webapp/test.xhtml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/test.xhtml
(rev 0)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/test.xhtml 2010-03-29
09:08:48 UTC (rev 12308)
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:head>
+ <title>Java EE 6 Starter Application</title>
+ <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
+ </h:head>
+ <h:body>
+ <h:outputLabel value="Hello World!"/>
+ </h:body>
+</html>
\ No newline at end of file