00T实习指南 顾天晓 ktxjoro@gmail.com
OOT实习指南 顾天晓 ktxjoro@gmail.com
内容提要 ·运行起Jpetstore ·Jpetstore源码解析 ·Spring loC ·Spring MVC ·实习项目分析
内容提要 • 运行起Jpetstore • Jpetstore源码解析 • Spring IoC • Spring MVC • 实习项目分析
运行Jpetstore ·搭建环境 -下载安装jdk -下载安装SpringSource Tool Suite ·下载subversion插件 一下载Jpetstore源码 ·编译、打包、部署
运行Jpetstore • 搭建环境 – 下载安装jdk – 下载安装SpringSource Tool Suite • 下载subversion插件 – 下载Jpetstore源码 • 编译、打包、部署
下载subversion插件 。Eclipse Plugin -http://www.eclipse.org/subversive/downloads.ph 力 Help->Install New Software -Update site http://download.eclipse.org/technology/subversive/0.7 /update-site/ ·SpringByExample
下载subversion插件 • Eclipse Plugin – http://www.eclipse.org/subversive/downloads.ph p – Help->Install New Software – Update site • http://download.eclipse.org/technology/subversive/0.7 /update-site/ • SpringByExample
下载jpetstore源码 。SpringSource.org -https://src.springsource.org/svn/spring-samples/ 一 svn co https://src.springsource.org/svn/spring- samples/jpetstore/trunk/org.springframework.sa mples.jpetstore/jpetstore -Use subversion plugin SpringByExample
下载jpetstore源码 • SpringSource.org – https://src.springsource.org/svn/spring-samples/ – svn co https://src.springsource.org/svn/spring- samples/jpetstore/trunk/org.springframework.sa mples.jpetstore/ jpetstore – Use subversion plugin • SpringByExample
编译、打包源码 ·Maven -http://maven.apache.org/ -STS已经集成Maven插件 ·Project Object Model -pom.xml validate,compile,test,package,integration-test, verify,install,deploy
编译、打包源码 • Maven – http://maven.apache.org/ – STS已经集成Maven插件 • Project Object Model – pom.xml – validate, compile, test, package, integration-test, verify, install, deploy
编译、打包源码 。pom.xml - - - -
编译、打包源码 • pom.xml – – – –
编译、打包源码 Jpetstore readme.txt -1.Run "mvn package"to generate the WAR file -2.Copy the generated "target/org.springframework.samples.jpetstore-1.0.0- SNAPSHOT.war to "/webapps/jpetstore.war" -3.Start HSQLDB via "db/hsqldb/server.bat"or "db/hsqldb/server.sh" -4.Start Tomcat (default port will be 8080) -5.Open "http://localhost:8080/jpetstore"in an Internet browser
编译、打包源码 • Jpetstore readme.txt – 1. Run "mvn package" to generate the WAR file – 2. Copy the generated "target/org.springframework.samples.jpetstore-1.0.0- SNAPSHOT.war" to “/webapps/jpetstore.war" – 3. Start HSQLDB via "db/hsqldb/server.bat" or "db/hsqldb/server.sh" – 4. Start Tomcat (default port will be 8080) – 5. Open "http://localhost:8080/jpetstore" in an Internet browser
编译、打包源码 ·修改pom.xml -3.0.4.RELEASE -添加slf4j-nop-1.5.2.jar运行依懒支持 org.slf4j slf4j-nop 1.5.2 runtime
编译、打包源码 • 修改pom.xml – 3.0.4.RELEASE – 添加slf4j-nop-1.5.2.jar运行依赖支持 org.slf4j slf4j-nop 1.5.2 runtime
编译、打包源码 ·启动数据库hsqldb windows:server.bat Linux:server.sh Server.bat -mvn -f %~dpopom.xml -Ddb.file=%~dpojpetstore exec:java
编译、打包源码 • 启动数据库hsqldb – windows:server.bat – Linux:server.sh • Server.bat – mvn -f %~dp0pom.xml -Ddb.file=%~dp0jpetstore exec:java