Skip to content

Commit 6082a92

Browse files
committed
added correct scope annotation
included one line description
1 parent 5ebd872 commit 6082a92

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cdi/scopes/src/main/java/org/javaee7/cdi/bean/scopes/MyRequestScopedBean.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
/**
4545
* @author Arun Gupta
46+
*
47+
* This class represents a Request Scoped CDI bean. The container will create a new instance of this bean for every single HTTP request.
4648
*/
4749
@RequestScoped
4850
public class MyRequestScopedBean {

cdi/scopes/src/main/java/org/javaee7/cdi/bean/scopes/MySessionScopedBean.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@
3939
*/
4040
package org.javaee7.cdi.bean.scopes;
4141

42-
import javax.enterprise.context.RequestScoped;
42+
import java.io.Serializable;
43+
import javax.enterprise.context.SessionScoped;
4344

4445
/**
4546
* @author Arun Gupta
47+
*
48+
* This class represents a Session Scoped CDI bean. Once injected, the container will hold on to the instance of this bean until
49+
* the HTTP session expires. A new instance would be created with start of a fresh HTTP session
4650
*/
47-
@RequestScoped
48-
public class MySessionScopedBean {
51+
@SessionScoped
52+
public class MySessionScopedBean implements Serializable{
4953
public String getID() {
5054
return this + "";
5155
}

0 commit comments

Comments
 (0)