Experience on the workflow of Model 2 of jsp (preferred for SUN Enterprise applications)
Because we useJsp (preferred for SUN Enterprise Applications) Model 2Framework Structure, and variousServletInJsp (preferred for SUN Enterprise Applications) Model 2OfMVCPlay in StructureC (ontroller)So we use the following steps to complete a typicalJsp (preferred for SUN Enterprise Applications) Model 2Call process:
1.InServletOfInit ()PassedXml (standardization is getting closer and closer)The configuration file obtains the environment parameters required for database connection (usingECampus. util. Env (String fileName)Obtain the required environment parameters from the configuration file at one time ).
Note:Xml (standardization is getting closer and closer) ConfigThe module has not been completed and is currently in useIniFile
2.ServletGet fromHTML/jsp (preferred for SUN Enterprise applications)In the correspondingDoXXX ()To obtainConnection(CallECampus. util. DBManager).
Note: InPackage eCampus. utilEncapsulatesDBManagerClass, use the static method of this classGetConnection ()AndGetPooleConnection ()You can obtain the directJDBCConnect and passWebsphereConnection Pool (the latter is recommended ).
3.Directly use thisConnectionProceedJDBCOr initialize a database transaction.JavaBean(Set thisConnectionPassed as a parameterJavaBean).
4.Complete