1、javaEJB1EJB2.0? EJB2.0EJB1.1?BeanEJBEJBEJBEJBEJBEJBEJBJSP,Servlet,EJB,JNDI,JDBC,JMS.2EJBJAVA BEAN:Java Bean Java BeanJavaBeanJava BeanTomcat)Java BeanJava BeanSerializableBeanJava BeanCOMCOMEnterprise Java Bean DCOMJavaRMIEJBEJBWebspereWebLogicEJBEJBEJBEJBEJBEJB3EJB:EJB:Remote Interface package Bean
2、s;import javax.ejb.EJBObject;import java.rmi.RemoteException;public interface Add extends EJBObject/some method declareHome Interface package Beans;import java.rmi.RemoteException;import jaax.ejb.CreateException;import javax.ejb.EJBHome;public interface AddHome extends EJBHome/some method declareEJB
3、package Beans;import java.rmi.RemoteException;import javax.ejb.SessionBean;import javx.ejb.SessionContext;public class AddBean Implements SessionBean/some method declareJ2EE,MVC1MVC?:MVCModel-View-Controller“Model“ -JavaBeanEJB “View“ JSP“Controller“ Servlet-2WEB SERVER3J2EE:Je22Sun(multi-diered),(d
4、istributed),(component-base)(enterpriese application model).(tier)(clietn tier),web,Business,(EIS)4WEB SERVICEJSWDLJAXPJAXMSOAPUDDI,WSDLWeb ServiceWSDLSOAP-(Simple Object Access Protocol)XML-UDDI UDDIWebWeb ServiceWeb Service-5BSCS6STRUTS(STRUTS)StrutsJava Servlet/JavaServer PagesWebframework Struts
5、MVC(Model-View-Controller) Struts.controller servletAction.JSPtagcontroller servlet.XMLJava reflection APIsJavaBeans1?MVCJSP/ServletJ2EE2UMLUML,(),(,),JavaScript1?var re=/d1,8$|.d1,2$/;var str=document.form1.all(i).value;var r=str.match(re);if (r=null)sign=-4;break;elsedocument.form1.all(i).value=pa
6、rseFloat(str);CORBA1CORBA?CORBA (Common Object Request Broker Architecture) (Object Management Group OMG)(IDL), (binding:)- LINUX1LINUXGDILINUX“GDI1234*5678-9Socket(TCPUDPJava)*10Java11JDBC*12XML13Java14JavaJSP17* 2forward redirect3JSPservlet1doGet()doPost()2servletinit()service()3servlet4servlet5se
7、rvlet6EJB*1EJB2EJBEJBBean EJB EJBRemoteLocalHomeLocalHomeBean2EJBSessionBean EntityBean Message DrivenBeanBeanStatefulStatelessBeanBeanBMPCMP3bean Stateless Session BeanEntity BeanMessage Driven BeanEntity BeanStatefull Session BeanCacheEJB ObjectcreateremoveBeancreateCacheBeanBean4Statefull Session
8、 Bean CacheBeanMRUNRUEJBEJB ObjectBeanBeanejbActiveejbPassivate5remotehomeremoteEJBhomeEJBEJB6EJB JNDIJNDI Home HomeCreateRemote Remote12SQLweblogic1 weblogic?WeblogicDomianstartServerNameset MEM_ARGS=-Xms32m -Xmx200m32M200M2 weblogic()?commenvset PRODUCTION_MODE=true3 ? WLS_USERWLS_PWboot.propertie
9、s.4 weblogic(,Domain)jmsejb,?Domainconfig.xml5 weblogicDomain?helloWorld.jsp,http:/:/helloword.jsp? javaBean?DomainapplicationsWebWebjspJavabeanWEB-INFclasses6 weblogic-EJB?DeploymentEJB7 weblogicsslj2ee()sslDemoIdentity.jksDemoTrust.jks KeyStoreSSLEnable SSLCAidentitytrust keystoreSSL8weblogicejbEJ
10、Bejb-jar.xml,weblogic-ejb-jar.xmlCMPBeanweblogic-cmp-rdbms-jar.xml9EJBHome,.Home10weblogicBeanpersistentnon-persistenpersistentMDB,EJBJMSMDBnon-persistent11j2ee?Session Facade PatternSessionBeanEntityBeanMessage Facade PatternEJB Command PatternCommand JavaBeansSessionBeanData Transfer Object FactoryDTO FactoryEntityBeanGeneric Attribute AccessAttibuteAccessEntityBeanBusiness InterfaceBean-EJBfrom java-cn