1 Reply Latest reply on Oct 23, 2007 10:06 AM by sjmenden

    How to outject without @Out annotation

    paradigmza

      Hi,

      I see there is a way to inject by using Componenet.getInsance.
      Is there a way to outject a object with out using the annotation?

      Thanks.

      Sean.

        • 1. Re: How to outject without @Out annotation
          sjmenden

          You can look up the component and automatically create it if it doesn't exist like:
          MyBean myBean = Component.getInstance("myBean", true);

          Then set it to whichever context you want via:
          Contexts.getSessionContext().set("myBean", myBean);


          The above is not a perfect example, because if the myBean is ScopeType.SESSION, there is no reason to set it again in the Session context.

          -Samuel