JSP调用EJB中文资料,请参考以下地址:
http://www.yesky.com/20010309/163084.shtml

解决方案 »

  1.   

    假设我们已经写好了一个EJB。也已经启动了IAS,并配置好。其JNDI名字为“Sample”。要从JSP中调用EJB,需要先把javax.naming.* 、javax.rmi.PortableRemoteObject import进来,另外,还要把EJB组件的home接口,remote接口也import进来:〈%@ page import = "javax.naming.*"%>  //JNDI名字服务模块<%@ page import = "javax.rmi.PortableRemoteObject"%>  //RMI调用模块<%@ page import = "samples.*"%>   //EJB的home,remote接口<%InitialContext ctx = new InitialContext();  //初始化上下文Object ref = ctx.lookup("Sample");      //通过JNDI名字得到对象的接口SampleHome samplehome;samplehome=(SampleHome)PortableRemoteObject.narrow(ref,SampleHome.class);   //把对象强制转化为home接口类。这样就得到了EJB对象的Home接口,然//后再按EJB规范,根据不同的EJB类型,通过不同的方法得到EJB的//Home接口类。SampleRemote remote = samplehome.create();   //通过home接口的create方法得到remote接口。   //接下来就可以通过remote来调用EJB中的方法了。…………%>
      

  2.   

    Status status = getStatus(request);
    Attribute attribute = new Attribute();
    这两个是类吗?起什么作用?