Author: pete.muir(a)jboss.org
Date: 2009-09-22 11:13:35 -0400 (Tue, 22 Sep 2009)
New Revision: 3733
Modified:
examples/trunk/jsf/login/build.xml
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Login.java
Log:
Fix example
Modified: examples/trunk/jsf/login/build.xml
===================================================================
--- examples/trunk/jsf/login/build.xml 2009-09-22 15:04:31 UTC (rev 3732)
+++ examples/trunk/jsf/login/build.xml 2009-09-22 15:13:35 UTC (rev 3733)
@@ -2,6 +2,6 @@
<property name="example.name" value="webbeans-login" />
- <import file="../build.xml" />
+ <import file="../../build.xml" />
-</project>
\ No newline at end of file
+</project>
Modified:
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java
===================================================================
---
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java 2009-09-22
15:04:31 UTC (rev 3732)
+++
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java 2009-09-22
15:13:35 UTC (rev 3733)
@@ -3,9 +3,10 @@
import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Default;
+import javax.inject.Named;
-@RequestScoped @Named
+@RequestScoped @Named @Default
public class Credentials implements Serializable {
private String username;
Modified:
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java
===================================================================
---
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java 2009-09-22
15:04:31 UTC (rev 3732)
+++
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java 2009-09-22
15:13:35 UTC (rev 3733)
@@ -8,9 +8,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import javax.enterprise.inject.BindingType;
+import javax.inject.Qualifier;
@Retention(RetentionPolicy.RUNTIME)
@Target({TYPE, METHOD, FIELD})
-@BindingType
+@Qualifier
public @interface LoggedIn {}
Modified:
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Login.java
===================================================================
---
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Login.java 2009-09-22
15:04:31 UTC (rev 3732)
+++
examples/trunk/jsf/login/src/main/java/org/jboss/webbeans/examples/login/Login.java 2009-09-22
15:13:35 UTC (rev 3733)
@@ -5,16 +5,16 @@
import java.util.List;
import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.Named;
import javax.enterprise.inject.Produces;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
@SessionScoped @Named
public class Login implements Serializable {
- @Current Credentials credentials;
+ @Inject Credentials credentials;
//@PersistenceContext EntityManager userDatabase;
private User user;
@@ -47,7 +47,8 @@
return user!=null;
}
- @Produces @LoggedIn User getCurrentUser() {
+ @Produces @LoggedIn
+ public User getCurrentUser() {
return user;
}