1 Reply Latest reply on Sep 3, 2010 7:11 AM by Nicklas Karlsson

    scope defined within a bean

    nimo stephan Master

      I have this:



      @SessionScoped @Named 
      public class MyBean implements Serializable{
      
      
      @Inject @RequestScoped Users u;
      
      } 



      The object Users is no-scoped:


      public class Users implements Serializable{
      
      
      } 



      I have the following questions:


      You see, I defined the instance u as requestscoped, but it does not work. why?


      If I define Users as sessionscoped:


      @SessionScoped
      public class Users implements Serializable{
      
      
      } 



      would this




      @SessionScoped @Named 
      public class MyBean implements Serializable{
      
      
      @Inject @New @RequestScoped Users u;
      
      } 



      overwrite the scope of (the new) instance of u?