rapidjava

所属分类:Java编程
开发工具:Java
文件大小:8372KB
下载次数:24
上传日期:2007-07-18 21:36:07
上 传 者rock_w_123
说明:  《java敏捷开发--使用spring、hibernate和eclipse》源码
(《 java Xi Kai-hang, use the vertical spring) hibernate Core Tai tungsten eclipse 》)

文件列表:
rapidjava(java敏捷开发)代码\lib\activation.jar (55147, 2005-05-07)
rapidjava(java敏捷开发)代码\lib\antlr-2.7.6rc1.jar (444689, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\asm-attrs.jar (16777, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\asm.jar (26360, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\cglib-2.1.3.jar (282338, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\commons-beanutils-1.7.0.jar (188671, 2006-02-12)
rapidjava(java敏捷开发)代码\lib\commons-collections-2.1.1.jar (175426, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\commons-lang-2.1.jar (207723, 2005-06-12)
rapidjava(java敏捷开发)代码\lib\commons-logging-1.0.4.jar (38015, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\displaytag-1.1.jar (210432, 2006-02-12)
rapidjava(java敏捷开发)代码\lib\displaytag-export-poi-1.1.jar (12590, 2006-02-12)
rapidjava(java敏捷开发)代码\lib\dom4j-1.6.1.jar (313898, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\ehcache-1.1.jar (47531, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\hibernate3.jar (1925498, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\hsqldb.jar (630486, 2005-08-20)
rapidjava(java敏捷开发)代码\lib\itext-1.3.jar (1145105, 2006-02-12)
rapidjava(java敏捷开发)代码\lib\javax.servlet.jar (132271, 2006-01-05)
rapidjava(java敏捷开发)代码\lib\jstl.jar (16630, 2006-01-24)
rapidjava(java敏捷开发)代码\lib\jta.jar (8812, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\junit.jar (121070, 2002-09-04)
rapidjava(java敏捷开发)代码\lib\log4j-1.2.11.jar (350627, 2005-12-12)
rapidjava(java敏捷开发)代码\lib\mail.jar (355030, 2005-09-09)
rapidjava(java敏捷开发)代码\lib\quartz-1.5.1.jar (353444, 2005-10-09)
rapidjava(java敏捷开发)代码\lib\spring-hibernate3.jar (109382, 2006-01-11)
rapidjava(java敏捷开发)代码\lib\spring-mock.jar (70231, 2005-12-22)
rapidjava(java敏捷开发)代码\lib\spring.jar (1859307, 2006-01-11)
rapidjava(java敏捷开发)代码\lib\standard.jar (315295, 2006-01-24)
rapidjava(java敏捷开发)代码\springhibernate\build.xml (2791, 2006-03-19)
rapidjava(java敏捷开发)代码\springhibernate\conf\springhibernate-servlet.xml (4446, 2006-03-18)
rapidjava(java敏捷开发)代码\springhibernate\conf\web.xml (851, 2006-03-17)
rapidjava(java敏捷开发)代码\springhibernate\src\controller\TimesheetSaveController.java (1375, 2006-03-17)
rapidjava(java敏捷开发)代码\springhibernate\src\model\Timesheet.hbm.xml (911, 2006-02-28)
rapidjava(java敏捷开发)代码\springhibernate\src\model\Timesheet.java (2971, 2006-03-17)
rapidjava(java敏捷开发)代码\springhibernate\src\model\TimesheetManager.java (352, 2006-03-17)
rapidjava(java敏捷开发)代码\springhibernate\src\model\TimesheetManagerImpl1.java (780, 2006-03-17)
rapidjava(java敏捷开发)代码\springhibernate\src\model\TimesheetManagerImpl2.java (520, 2006-03-17)
rapidjava(java敏捷开发)代码\springhibernate\src\view\dberror.jsp (1384, 2006-03-19)
rapidjava(java敏捷开发)代码\springhibernate\src\view\timesheetsave.jsp (14, 2006-02-28)
rapidjava(java敏捷开发)代码\timex\antextras.xml (1341, 2006-02-26)
... ...

Hello and welcome! The files and sub-directories under this directory belong to a sample application named, Time Expression. This is built using: - the Spring Framework (http://springframework.org/) - Hibernate (http://hibernate.org/) - HSQLDB (http://hsqldb.org) - Display Tag (http://displaytag.sourceforge.net) ...and other open source Java tools. The 3 key projects in this directory can be found under these sub-directories: 1. timex/ - Time Expression (timex/ sub-directory - through chapter 7) 2. timex2/ - Time Expression, refactored version (chapter 10) 3. springhibernate/ - Spring+Hibernate integration demo (Chapter 10) These have been taken directly from Anil Hemrajani's book on Rapid Open Source Java Development (details available at visualpatterns.com). The rest of this page provides some additional information about these projects. Enjoy, Anil Hemrajani ------------------------------------------------------------------------------------------------ Note: You may wish to visit visualpatterns.com for potential updates. ------------------------------------------------------------------------------------------------ 1) timex/ and timex2/ ===================== See Chapter 2, "The Sample Application: An Online Timesheet System" See Chapter 3, "XP and AMDD Based Architecture and Design Modeling" This section is related to the sample application named, Time Expression introduced in chapter 2 of book. Note, timex2/ contains almost the same files as timex/, except refactored to leverage Spring's declarative transaction management, the displaytag tag library, etc. Since both directories are very similar, I have only listed the key files/directories for timex/ next: rapidjava/lib (stored here to make bookcode.zip smaller; typically under timex/) rapidjava/timex/antextras.xml rapidjava/timex/build.xml rapidjava/timex/local.properties rapidjava/timex/README.txt rapidjava/timex/timexhsqldb.xml rapidjava/timex/data rapidjava/timex/dist rapidjava/timex/src/java/com/visualpatterns/timex/controller rapidjava/timex/src/java/com/visualpatterns/timex/job rapidjava/timex/src/java/com/visualpatterns/timex/model rapidjava/timex/src/java/com/visualpatterns/timex/test rapidjava/timex/src/java/com/visualpatterns/timex/util rapidjava/timex/src/java/com/visualpatterns/timex/view Exploded web application directory: rapidjava/timex/build/timex/WEB-INF/classes rapidjava/timex/build/timex/WEB-INF/jsp rapidjava/timex/build/timex/WEB-INF/lib [To Test The Application] 1. Change directory (cd) to rapidjava/timex/ 2. Build/deploy timex.war (or timex2.war) to web/application server - Tweak deploy.dir key=value in local.properties file, as shown in this example: deploy.dir=/apache-tomcat-5.5.15/webapps - Run "ant deploy" 3. Start HSQLDB server (ant -f timexhsqldb.xml starthsql) See Chapter 5, "Using Hibernate For Persistent Objects" 4. Start Tomcat or your own web/application server See Chapter 7, "The Spring Web MVC Framework" See Chapter 8, "The Eclipse Phenomenon" 5. Connect using something like http://localhost:8080/timex/ (or timex2/). 6. Login using the following credentials: Employee id: 1 Password: rapidjava 7. Other options: a. Run HSQLDB manager to browse our database: ant -f timexhsqldb.xml hsqldm Type: Server URL: jdbc:hsqldb:hsql://localhost:9005/timex b. See Chapter 8 for details on how to create an Eclipse project from an existing Ant build file. Eclipse will enable you to start Tomcat, build/deploy our war files, debug the application, browse/edit the Java code, explore the database, and much more -- all from within one IDE! For example, you can create 3 separate projects using the 3 build.xml files found in the timex/, timex2 and springhibernate/ directories. If you do create the projects in Eclipse (which I highly recommend doing), be sure to link our build.xml files in the "Ant" view and also "Add Spring Project Nature" for the 3 projects (see Chapter 8 for details). c. Run ant -f timexhsqldb.xml execddl to recreate the test data ------------------------------------------------------------------------------------------------ 2) springhibernate/ =================== See Chapter 10, "Beyond The Basics" This directory files to demo how the Spring+Hibernate integration works. By integrating Hibernate with Spring, you can a lot of benefits such as declarative transaction management, easier testing by swapping out session factory, and more. The following are some key files/directories related to this demo: rapidjava/lib (stored here to make bookcode.zip smaller; typically under springhibernate/) rapidjava/springhibernate/build rapidjava/springhibernate/conf rapidjava/springhibernate/src rapidjava/springhibernate/build/springhibernate/WEB-INF/classes rapidjava/springhibernate/build/springhibernate/WEB-INF/jsp rapidjava/springhibernate/build/springhibernate/WEB-INF/lib rapidjava/springhibernate/build/springhibernate/WEB-INF/classes/controller rapidjava/springhibernate/build/springhibernate/WEB-INF/classes/model rapidjava/springhibernate/build/springhibernate/WEB-INF/classes/view rapidjava/springhibernate/src/controller rapidjava/springhibernate/src/model rapidjava/springhibernate/src/view [To Test The Application] 1. Change directory (cd) to rapidjava/springhibernate/ 2. Build/deploy springhibernate.war to web/application server - Tweak deploy.dir property in the build.xml file; as shown in this example: - Run "ant deploy" 3. Start HSQLDB server from timex/ or timex2/ directory (ant -f timexhsqldb.xml starthsql) See Chapter 5, "Using Hibernate For Persistent Objects" 4. Start Tomcat or your own web/application server See Chapter 7, "The Spring Web MVC Framework" See Chapter 8, "The Eclipse Phenomenon" 5. Connect using something like http://localhost:8080/springhibernate/timesheetsave1.htm http://localhost:8080/springhibernate/timesheetsave2.htm Note, if you invoke these URLs in sequence, you will be able to see a demo of how Spring redirects mapped exceptions to web pages. For example, timesheetsave1.htm will save a record; timesheetsave2 will try to add the same record again thereby causing the following exception: org.springframework.dao.DataIntegrityViolationException Of course, this also demonstrates Spring's consistent data exception handling. Visit springframework.org for details. ------------------------------------------------------------------------------------------------ Visit http://visualpatterns.com for potential updates.

近期下载者

相关文件


收藏者