Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2160

Cannot initialize @ViewScoped bean with bean-discovery-mode="annotated"

    Details

      Description

      I have a CDI bean.

      @Named("viewCDI")
      //+@javax.enterprise.context.SessionScoped
      //+@com.rico.cdi.CDIViewScoped
      //-@javax.faces.view.ViewScoped
      //-@javax.faces.bean.ViewScoped
      public class HelloViewScoped implements java.io.Serializable{
        private Date  created;  
        public HelloViewScoped(){
          created=new Date();  
        }
        public Date getCreated() {
          return created;
        }
      }
      

      In beans.xml I wrote:
      version="1.1" bean-discovery-mode="annotated">

      The problem is that is is not visible to JSF wen I use @javax.faces.view.ViewScoped

      The only path to get it visibe is to write a Stereotype annotation:

      @javax.enterprise.inject.Stereotype
      @javax.faces.view.ViewScoped
      @Target(TYPE)
      @Retention(RUNTIME)
      public @interface CDIViewScoped  {}
      

      }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mkouba Martin Kouba
                Reporter:
                vigor78 Igor Vlasov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: