springstrutsibatis

所属分类:Java编程
开发工具:Java
文件大小:515KB
下载次数:314
上传日期:2007-06-21 17:13:02
上 传 者xiaolei_1
说明:  spring 开源框架学习经典范例 采用spring+STRUTS+ibatis设计!是学习java网络编程的好例子
(spring revenue learning framework classic example of using spring STRUTS ibatis Design! Learning java network programming a good example!)

文件列表:
jpetstore\annotation\build.bat (144, 2005-07-19)
jpetstore\annotation\build.xml (5464, 2005-03-24)
jpetstore\annotation\src\org\springframework\samples\jpetstore\domain\logic\PetStoreAnnotationImpl.java (5605, 2005-05-24)
jpetstore\annotation\src\org\springframework\samples\jpetstore\domain\logic (0, 2006-11-21)
jpetstore\annotation\src\org\springframework\samples\jpetstore\domain (0, 2006-11-21)
jpetstore\annotation\src\org\springframework\samples\jpetstore (0, 2006-11-21)
jpetstore\annotation\src\org\springframework\samples (0, 2006-11-21)
jpetstore\annotation\src\org\springframework (0, 2006-11-21)
jpetstore\annotation\src\org (0, 2006-11-21)
jpetstore\annotation\src (0, 2006-11-21)
jpetstore\annotation\warfile.bat (19, 2005-03-17)
jpetstore\annotation\WEB-INF\applicationContext.xml (2915, 2005-07-04)
jpetstore\annotation\WEB-INF\declarativeServices.xml (2172, 2005-07-04)
jpetstore\annotation\WEB-INF\web.xml (6735, 2005-06-25)
jpetstore\annotation\WEB-INF (0, 2006-11-21)
jpetstore\annotation (0, 2006-11-21)
jpetstore\attributes\build.bat (144, 2005-07-19)
jpetstore\attributes\build.xml (6942, 2005-03-24)
jpetstore\attributes\warfile.bat (19, 2004-01-13)
jpetstore\attributes\WEB-INF\applicationContext.xml (2903, 2005-07-04)
jpetstore\attributes\WEB-INF\declarativeServices.xml (2529, 2005-07-04)
jpetstore\attributes\WEB-INF\web.xml (6734, 2005-06-25)
jpetstore\attributes\WEB-INF (0, 2006-11-21)
jpetstore\attributes (0, 2006-11-21)
jpetstore\build.bat (138, 2005-07-19)
jpetstore\build.xml (5035, 2005-03-17)
jpetstore\client\client.bat (487, 2005-07-15)
jpetstore\client\client.properties (210, 2004-01-05)
jpetstore\client\client.sh (842, 2005-03-17)
jpetstore\client\clientContext.xml (4103, 2005-02-14)
jpetstore\client (0, 2006-11-21)
jpetstore\db\hsqldb\jpetstore-hsqldb-dataload.sql (9787, 2004-09-27)
jpetstore\db\hsqldb\jpetstore-hsqldb-schema.sql (4699, 2004-09-27)
jpetstore\db\hsqldb\jpetstore.properties (457, 2005-07-21)
jpetstore\db\hsqldb\jpetstore.script (11154, 2005-07-21)
jpetstore\db\hsqldb\manager.bat (103, 2005-10-23)
jpetstore\db\hsqldb\manager.sh (76, 2005-05-12)
jpetstore\db\hsqldb\server.bat (107, 2005-10-23)
... ...

========================================= == Spring JPetStore sample application == ========================================= @author Juergen Hoeller Based on Clinton Begin's JPetStore (http://www.ibatis.com). 1. MOTIVATION Features a Spring-managed middle tier with iBATIS Database Layer as data access strategy, in combination with Spring's transaction and DAO abstractions. Can work with local JDBC transactions or JTA, with the latter on two databases. Uses the same data model and demo contents as the original JPetStore. See the context definitions "WEB-INF/dataAccessContext-local.xml" respectively "WEB-INF/dataAccessContext-jta.xml" for details. Offers two alternative web tier implementations with the same user interface: one based on Spring's web MVC, and one based on Struts 1.1. The latter is close to the original JPetStore but reworked for JSTL, to make the JSP implementations as comparable as possible. See "WEB-INF/web.xml", "WEB-INF/petstore-servlet.xml", and "WEB-INF/struts-config.xml" for details. Compared to the original JPetStore, this implementation is significantly improved in terms of internal structure and loose coupling: Leveraging Spring's application context concept, there's a central place for wiring application objects now. The most notable improvement is the former PetStoreLogic, now called PetStoreFacade: It is no longer concerned with configuration, resource, or transaction details. Note that the Spring-based web tier implementation is deliberately similar to the Struts-based one and does not aim to improve in terms of in-place error messages or the like. The inclusion of two web tier alternatives outlines the differences as well as the similarities in the respective programming model, and also illustrates the different configuration styles. This version of JPetStore also demonstrates various remoting options with Spring: Hessian, Burlap, RMI, and Web Services via Apache Axis. They are all provided out-of-the-box by the default web application (note that RMI is commented out to avoid conflicts with EJB containers). The "client" directory contains a simple command-line client that invokes the exported OrderService via all protocols. 2. BUILD AND DEPLOYMENT This directory contains the web app source. For deployment, it needs to be built with Apache Ant. The only requirements are JDK >=1.3 and Ant >=1.5. Run "build.bat" in this directory for available targets (e.g. "build.bat build", "build.bat warfile"). Note that to start Ant this way, you'll need an XML parser in your classpath (e.g. in "%JAVA_HOME%/jre/lib/ext"; included in JDK 1.4). You can use "warfile.bat" as a shortcut for WAR file creation. The WAR file will be created in the "dist" directory. To execute the web application with its default settings, simply start the HSQLDB instance in the "db/hsqldb" directory, for example using "server.bat". For other databases, you'll need to use the corresponding schema and load scripts in the "db" subdirectories (same as with the original JPetStore). In the local case, the JDBC settings can be adapted in "WEB-INF/jdbc.properties". With JTA, you need to set up corresponding DataSources in your J2EE container. Note that the "WEB-INF/dataAccessContext-*.xml" files might have to be adapted for certain databases like MS-SQL and Oracle, to use appropriate generation strategies for order IDs. See the corresponding commented-out DAO definitions in the context XML files. WARNING: As of Spring 1.0 M4, only HSQLDB will be properly tested. We are happy to accept any feedback on other databases. A guide to step-by-step deployment, assuming JDK 1.4.x and Tomcat 4.x: 1. if not already set, set the JAVA_HOME environment variable 2. run "ant warfile" respectively "warfile.bat" to generate the WAR file 3. copy the generated "dist/jpetstore.war" to Tomcat's "webapps" directory 4. start HSQLDB via "db/hsqldb/server.bat" respectively "server.sh" 5. start Tomcat (default port will be 8080) 6. open "http://localhost:8080/jpetstore" in an Internet browser If you want to test remote service access: 1. create an order with the JPetStore web UI (first order number will be 1000) 2. adapt server URL in "client/client.properties" (if not using the default) 3. switch to the "client" directory as execution directory 4. run "client.bat 1000" to fetch and show the order with number 1000 5. run "client.bat 1000 10" to fetch the order 10 times per protocol 3. VERSIONS WITH SOURCE-LEVEL METADATA See the "attributes" and "annotation" directories for examples of declarative transaction management driven by source-level metadata. These versions leverage Spring's simple metadata model, similar to that of .NET Enterprise Services, but extensible to arbitrary (possibly application-specific) declarative services. The JPetStore version in the "attributes" directory uses Jakarta Commons Attributes, which works on JDK >= 1.3. The version in the "annotation" directory uses JDK 1.5+ annotations in an analogous fashion (available since Spring 1.2). Each directory has its own build file, which invokes the attribute compilation process and builds the WAR, using its own application context XML files from its "WEB-INF" subdirectory. The WAR file will be created in the "dist" directory.

近期下载者

相关文件


收藏者