glassfish
  1. glassfish
  2. GLASSFISH-11303

EJB is not properly handled if referenced with <jsp:useBean tag from JSP page

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 9.0pe
    • Fix Version/s: V3
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      11,303

      Description

      When I reference a bean from a JSP page in a way

      <jsp:useBean id="info" scope="application"
      class="ch.ethz.tpcw.beans.ItemInfo" />

      , this bean is found and the methods can be called on it but it is not prepared
      as a bean: @EJB annotated fields are not set, @PostConstruct annotated method is
      not called and annotated entity manager field is not set. All this works in the
      same EAR application and with the same setup when I reference the same bean from
      the simple servlet:

      @EJB
      ItemInfoLocal info;

        Activity

        Hide
        ksak added a comment -

        The assumption about this use of jsp:useBean is incorrect. useBean does not have any special knowledge
        of Enterprise JavaBeans. Assigning a concrete Java class (which happens to be the bean class of an EJB
        component) to the class attribute merely results in that class being treated as a plain Java Bean, not an
        EJB. That means it will be instantiated but no EJB semantics will be applied.

        Show
        ksak added a comment - The assumption about this use of jsp:useBean is incorrect. useBean does not have any special knowledge of Enterprise JavaBeans. Assigning a concrete Java class (which happens to be the bean class of an EJB component) to the class attribute merely results in that class being treated as a plain Java Bean, not an EJB. That means it will be instantiated but no EJB semantics will be applied.

          People

          • Assignee:
            ksak
            Reporter:
            audriusa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: