Discussions

Web tier: servlets, JSP, Web frameworks: Jsp - weblogic - java beans

  1. Jsp - weblogic - java beans (2 messages)

    Hi,

    I am trying to use java beans in my jsp pages. where should I put them in weblogic server path.

    thanks,

    Threaded Messages (2)

  2. You have to deploy the EJB in the WebLogic Server, and give it a name in the JNDI tree.

    From the JSP page, you have to lookup the EJB through the JNDI name. See the JSP+BeanManagedPersistance example that comes with WebLogic:

    <%!
      String pagetitle = "JSP example using EJBean-managed persistence";
      String url = "t3://localhost:7001";
      String accountId = "10020";

      // Declaring a Java class
      public Context getInitialContext() throws Exception {
        Properties p = new Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY,
              "weblogic.jndi.WLInitialContextFactory");
        p.put(Context.PROVIDER_URL, url);
        return new InitialContext(p);
      }

    .... more code ......
        
    %>
  3. Jsp - weblogic - java beans[ Go to top ]

    The JNDI names must be present in an XML deployment descriptor so that they may be deployed. Have you already packaged the beans into a jar? that jar must be included in the config file also.