[jboss-cvs] jboss-seam/examples/dvdstore/src/com/jboss/dvd/seam ...
Norman Richards
norman.richards at jboss.com
Mon Sep 17 16:58:13 EDT 2007
User: nrichards
Date: 07/09/17 16:58:13
Modified: examples/dvdstore/src/com/jboss/dvd/seam
AuthenticatorAction.java CheckoutAction.java
Log:
make sure authenticator puts currentUser in the session
Revision Changes Path
1.5 +4 -3 jboss-seam/examples/dvdstore/src/com/jboss/dvd/seam/AuthenticatorAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AuthenticatorAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/dvdstore/src/com/jboss/dvd/seam/AuthenticatorAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- AuthenticatorAction.java 2 Aug 2007 18:58:04 -0000 1.4
+++ AuthenticatorAction.java 17 Sep 2007 20:58:13 -0000 1.5
@@ -4,6 +4,7 @@
import javax.persistence.EntityManager;
import javax.persistence.PersistenceException;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
@@ -15,15 +16,14 @@
@Name("authenticator")
public class AuthenticatorAction implements Authenticator
{
- private static final String USER_VAR = "currentUser";
-
@In
private EntityManager entityManager;
@In Actor actor;
@In Identity identity;
- @Out(required=false) User currentUser;
+ @Out(required=false, scope=ScopeType.SESSION)
+ User currentUser;
public boolean authenticate()
{
@@ -43,6 +43,7 @@
identity.addRole("admin");
}
+ System.out.println("CURRENT USER IS " + currentUser);
return true;
}
}
1.11 +2 -7 jboss-seam/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CheckoutAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- CheckoutAction.java 25 Jun 2007 23:13:51 -0000 1.10
+++ CheckoutAction.java 17 Sep 2007 20:58:13 -0000 1.11
@@ -79,16 +79,11 @@
amount = completedOrder.getNetAmount();
customerName = completedOrder.getCustomer().getUserName();
- //return "complete;"
} catch (InsufficientQuantityException e) {
for (Product product: e.getProducts()) {
Contexts.getEventContext().set("prod", product);
FacesMessages.instance().addFromResourceBundle("checkoutInsufficientQuantity");
}
-
- //return null;
- } catch (Throwable t) {
- t.printStackTrace();
}
}
More information about the jboss-cvs-commits
mailing list