University of Cincinnati logo and link  
A Look at our Client
 
  UC ingot You could easily make something more robust than this.  But, this client does what we want, it proves that the EJB is up and running.  Save this as index.jsp in the root directory.
    • Note that we use an alternate - and perhaps more familiar - method of getting our stub reference.  Context.lookup takes a JNDI name as a parameter, and returns an object that implements HelloHome.
    • From here we can get a reference to our bean.


<p>Stay tuned for an important message: </p><br><br>
<p><%
   try {
      Context lContext = new InitialContext();
      HelloHome hHome = (HelloHome) lContext.lookup(
         "java:comp/env/ejb/simpleejb/Hello"
      );
      Hello hHello = hHome.create();
      out.println( "" + hHello.sayHello() );
   }
   catch( Exception e ) {
      out.println( "Caugth exception: " + e.getMessage() );
      e.printStackTrace();
   }
%></p><br><br>
<p>Have fun and see you soon</p>
 

 Deploying with JBoss