<%
      Properties props=new Properties();
      props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      props.setProperty("java.naming.provider.url","localhost:1099");
      props.setProperty("java.naming.factory.url.pkgs","org.jboss.naming");
      
      InitialContext ctx;
      try{
        ctx=new InitialContext(props);
        IHelloWorld h=(IHelloWorld)ctx.lookup("HelloWorld/remote");
        out.println(h.sayHello("persia."));
      }
      catch(NamingException e){
        out.println(e.getMessage());
      }
      
     %>
记得导入相关包
import="java.util.*,javax.naming.*,com.persia.session.*"
由于与ejb在同一个容器,无需jbossClient包。
将EJB项目和web客户端部署到JBOSS即可。

相关文章:

  • 2021-10-11
  • 2021-09-27
  • 2021-11-05
  • 2021-07-06
  • 2022-02-18
  • 2022-02-28
  • 2021-09-22
  • 2022-12-23
猜你喜欢
  • 2022-02-01
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
相关资源
相似解决方案