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

Producer field behavior differs from producer method

    Details

      Description

      This producer field inject a Temp object into the request scope, corretly.

      @Named @SessionScoped
      public class HelloWorld implements Serializable {

      @Produces @RequestScoped @TenTemp
      public Temp getTemp()

      { return new Temp(10); }

      }

      The same producer written as a field create a session scoped object (note that the main bean is session scoped too) instead of request scoped.

      @Named @SessionScoped
      public class HelloWorld implements Serializable

      { @Produces @RequestScoped @TenTemp Temp t = new Temp(10); }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                agori alberto Gori
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: