XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 2.18.0.Final
    • 2.5.0.Final
    • Java EE

      The command faces-new-bean should be able to add a scope. Then, depending on the scope, the generated code would be different (e.g. implements Serializable for most of the other stateful scopes)

      faces-new-bean --named MyBean --scoped SESSION
      

      This would generate the following code

      @Named
      @SessionScoped
      public class MyBean implements Serializable {
      
      }
      

      For the conversation scope we could add more code :

      faces-new-bean --named MyBean --scoped Conversation
      

      This would generate the following code

      @Named
      @ConversationScoped
      public class MyBean implements Serializable {
      
        @Inject
        private Conversation conversation;
      
        public String begin() {
          conversation.begin();
          return null;
        }
      
        public String end() {
          conversation.end();
          return null;
        }
      }
      

              agoncal Antonio Goncalves (Inactive)
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: