Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1761

Handling PostConstruct annotations - wrong order

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0, 1.2.1-SNAPSHOT
    • 1.2.7
    • None
    • None

    Description

      The specification states that managed bean methods annotated with @PostConstruct have to be called after the object is initialized and after dependency injection is performed. However, MyFaces calls those methods after the bean instance is created but before dependency injection is performed (for example, see http://www.nabble.com/myfaces-1.2.0-postConstruct-tf4760326.html ). In order to resolve this bug the LifecycleProvider interface has to be changed. Currently there's only one method responsible for creating/initializing a new bean: newInstance(). This design choice implicates that there's no possibility to seperate the steps "creating the bean" and "postconstructing the bean".

      Attachments

        1. postconstruct-demo.zip
          3 kB
          Bernhard Huemer
        2. MYFACES-1761-2.patch
          19 kB
          Leonardo Uribe
        3. MYFACES-1761-01.diff
          58 kB
          Paul Franklin McMahan
        4. MyFaces-1761.patch
          7 kB
          Bernhard Huemer

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lu4242 Leonardo Uribe
            bhuemer Bernhard Huemer
            Votes:
            9 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment