1 Reply Latest reply on Sep 21, 2003 4:50 AM by Pushpendra

    JavaBean is not accessible in jsp

    Pushpendra Newbie

      Hi:

      I have architechture where jsp in front end is communicating with BMP Bean using Java Bean. But when I use tag tag to call Java bean my jsp is giving compiling error, that is it is not finding this class. The same code works in Orion server.Any body can send an example of this architechture.

      There is example for just jsp connecting to EJB directly as follows:
      <%-- the ejb imports --%>
      <%@ page import = "javax.naming.InitialContext" %>
      <%@ page import = "javax.rmi.PortableRemoteObject" %>
      <%@ page import = "org.jboss.net.sample.hello.interfaces.HelloLocal" %>
      <%@ page import = "org.jboss.net.sample.hello.interfaces.HelloLocalHome" %>

      <%
      String helloEJB = request.getParameter("testEJB");
      %>

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


      JBoss-Example EJB Reply













      <h3>Hello World EJB Reply:</h3>




      <%
      if (helloEJB!=null){
      try {
      InitialContext lContext = new InitialContext();
      HelloLocalHome lHome = (HelloLocalHome) lContext.lookup( "Hello" );
      HelloLocal hl = lHome.create();
      helloEJB= helloEJB+"!";
      %>
      <h2><%=hl.hello(helloEJB) %></h2>
      <%
      hl.remove();
      } catch( Exception e ){
      e.printStackTrace();
      } // end try/catch
      } else {
      %>
      <h2></h2>
      <%
      } // end if/else
      %>





      <h3>Sourcecode</h3>
       



       





      But is there example to use Java Bean as a class between jsp and EJB.

      Regards,

      Pushpendra

        • 1. Re: JavaBean is not accessible in jsp
          Pushpendra Newbie

          Hi Everybody:

          I found the solution. It is simple, in JavaBean code define the package in which the javabean will go and in jsp when you call javabean specify package name before java bean class eg. javabean.DatabaseView_Autos, this will work fine in case people are using jsp - javabean - bmp architechture.

          Regards,

          Pushpendra Raval