预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共16页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

AHelloWorldApplicationusingSpringMVC TolearnanywebframeworkstartingwithaHelloWorldapplicationisagoodidea.OncewegetfamiliaritywiththeframeworkconfigurationitwouldbebettertodoaCRUD(Create,Read,Update,Delete)applicationwhichcoversvariousaspectsofawebframeworklikeValidations,RequestURLMappings,RequestParameterBinding,Pre-populatingformsetc.NowIamgoingtoexplainhowtowriteaSimpleCRUDapplicationusingSpringMVC3,HibernateandMySQL.OurApplicationisContactsManagementswhereyoucanvieworsearchcontacts,createnewcontacts,editordeleteexistingcontacts.Step#1:CreatetheCONTACTSTable CREATETABLECONTACTS ( idint(10)unsignedNOTNULLAUTO_INCREMENT, namevarchar(45)NOTNULL, addressvarchar(45)DEFAULTNULL, genderchar(1)DEFAULT'M', dobdatetimeDEFAULTNULL, emailvarchar(45)DEFAULTNULL, mobilevarchar(15)DEFAULTNULL, phonevarchar(15)DEFAULTNULL, PRIMARYKEY(id) ); Step#2:CopytheSpringMVC,HibernateandtheirdependentjarsintoWEB-INF/libfolder.IfyouareusingMavenyoucanmentionthefollowingdependencies. <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.8.1</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-web</artifactid> <version>3.0.5.RELEASE</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-core</artifactid> <version>3.0.5.RELEASE</version> <type>jar</type> <scope>compile</scope> <exclusions> <exclusion> <artifactid>commons-logging</artifactid> <groupid>commons-logging</groupid> </exclusion> </exclusions> </dependency> <dependency> <groupid>log4j</groupid> <artifactid>log4j</artifactid> <version>1.2.14</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-tx</artifactid> <version>3.0.5.RELEASE</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>jstl</groupid> <artifactid>jstl</artifac