File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
cdi/scopes/src/main/java/org/javaee7/cdi/bean/scopes Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 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
4850public class MyRequestScopedBean {
Original file line number Diff line number Diff line change 3939 */
4040package 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 }
You can’t perform that action at this time.
0 commit comments