Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
84Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Spring Live

Spring Live

Ratings:

4.71

(14)
|Views: 3,960 |Likes:
Published by srmd21
Spring Live Tutorial
Spring Live Tutorial

More info:

Published by: srmd21 on Dec 26, 2007
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/16/2013

pdf

text

original

 
Spring Live by Matt RaibleCopyright © 2004 by SourceBeat, LLC.Cover Copyright © 2004 by SourceBeat, LLC.All rights reserved.Published by SourceBeat, LLC, Highlands Ranch, Colorado.Managing Editor:James GoodwillTechnical Editor:Dion AlmaeCopy Editor:Amy KesicLayout Designer:Amy KesicCover Designer:Max HayesISBN: 0974884340Many designations used by organizations to distinguish their products are claimed as trademarks. These trademarkednames may appear in this book. We use the names in an editorial fashion only with no intention of infringing on thetrademark; therefore you will not see the use of a trademark symbol with every occurrence of the trademarked name.As every precaution has been taken in writing this book, the author and publisher will in no way be held liable for anyloss or damages resulting from the use of information contained in this book.
 
Spring LiveTable of Contentsiii
The History of Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2About Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Why Everyone Loves It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Common Criticisms of Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4How Spring Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4How Spring Makes J2EE Easier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Coding to Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Easy Testability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Reducing Coupling: Factory Pattern vs. Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Configuring and Binding Class Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Object/Relational Mapping Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Download Struts and Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Create Project Directories and an Ant Build File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Tomcat and Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Create Unit Test for Persistence Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Configure Hibernate and Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25How Spring Is Configured in Equinox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Implement UserDAO with Hibernate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Run Unit Test and Verify CRUD with DAO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Create Manager and Declare Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Create Unit Test for Struts Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Create Action and Model (DynaActionForm) for Web Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40Run Unit Test and Verify CRUD with Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Complete JSPs to Allow CRUD through a Web Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Verify JSP’s Functionality through Your Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Adding Validation Using Commons Validator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Add the Validator Plug-in to struts-config.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Edit the validation.xml File to Specify That lastName Is a Required Field . . . . . . . . . . . . . . . . . . . 54Change the DynaActionForm to DynaValidatorForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Configure Validation for save() Method, But Not for Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
 
Table of Contents

Activity (84)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
psykosomatik liked this
tvt61 liked this
sub_sahoo liked this
Akki Formville liked this
Hieu Do Trung liked this
wael_ayeche liked this
ykurok liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->