0 Replies Latest reply on Dec 21, 2005 1:03 AM by sel piso

    How to call bean in another package?

    sel piso Newbie

      i already created 2 package. in my JSP in package1 can call bean inside the package1. i dont know how to call from interface bean in package1 to bean in package2. Can anyone tell me, please?

      JSP file;
      <%@ page import="com.threesixty.Package1.package1.*"%>
      <%@ page import="java.io.*,java.util.*,javax.naming.*" %>
      <%//@ page import="com.threesixty.Package2.package2.*"%>

      <%!
      String message;
      %>

      <%
      // Make sure this page will not be cached by the browser
      response.addHeader("Pragma", "no-cache");
      response.addHeader("Cache-Control", "no-store");

      message = "Hello";

      //bean
      InitialContext ctx = new InitialContext();
      Package1Home home = (Package1Home) ctx.lookup("package1");
      Package1 remote = home.create();

      System.out.println("Lps Package1 remote kt JSP "+home);
      System.out.println("Lps Package1 remote kt JSP "+remote);


      System.out.println("Lps Package1 remote kt JSP");

      EmpMsg emp = remote.addMsg(message);
      System.out.println("Lps remote kt JSP "+emp);
      //response.sendRedirect("success.jsp");
      System.out.println("Lps EmpMsg emp kt JSP");


      %>