Spring samples中的jpetstore,基于iBATIS的jpetstore,数据库层使用iBATIS。在web层,提供了两种MVC可以选择,即Spring的MVC和Struts的MVC(1.1)。
测试环境:
JDK版本:1.5.0_12-b04
Tomcat版本:6.0.18
Spring版本:2.5.6
MySQL版本:5.1.32
(1)到Spring网站获取jpetstore例子的安装介质。到http://www.springsource.org/的download center,选择2.5.6-with-dependencies下载。
(2)解压下载的zip包,jpetstore例子在\spring-framework-2.5.6\samples\jpetstore目录。
(3)在MySQL库中创建jpetstore运行需要的数据库表,并导入一些初始数据。建表和导入数据的SQL语句在\spring-framework-2.5.6\samples\jpetstore\db\mysql目录。使用以下命令完成建表和数据导入,
mysql -h 127.0.0.1 -u root -p
CREATE DATABASE jpetstore;
USE jpetstore;
source \spring-framework-2.5.6\samples\jpetstore\db\mysql\jpetstore-mysql-schema.sql
source \spring-framework-2.5.6\samples\jpetstore\db\mysql\jpetstore-mysql-dataload.sql
(3)修改数据库配置文件,\spring-framework-2.5.6\samples\jpetstore\war\WEB-INF目录,修改jdbc.properties,
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/jpetstore?
jdbc.username=root
jdbc.password=
(4)在\spring-framework-2.5.6\samples\jpetstore\war\WEB-INF目录web.xml中,
<servlet-mapping>
<servlet-name>petstore</servlet-name>
<!--
<servlet-name>action</servlet-name>
-->
<url-pattern>*.do</url-pattern>
</servlet-mapping>
用来选择MVC是用Spring还是Struts,petstore代表使用Spring,action代表使用Struts。
(5)修改完配置文件后,\spring-framework-2.5.6\samples\jpetstore目录,运行warfile.bat,会在dist目录中创建jpetstore.war包,将此war包copy到Tomcat的webapps目录。
(6)启动Tomcat,在浏览器中输入http://127.0.0.1:8080/jpetstore,就可以看到jpetstore的主页。
分享到:
相关推荐
学习Spring 的例子JpetStore
NULL 博文链接:https://jnh.iteye.com/blog/452766
spring附带的例子 jpetstore 包括spring mvc 和 struts
NULL 博文链接:https://llhdf.iteye.com/blog/268601
用spring改造的jpetstore4.0,适用于jdk7+,tomcat6+。mysql数据库
最新spring带的JPetStore的MyEclipse项目,包括了数据库,可用hsqldb直接运行,可以直接导入MyEclipse中并部署运行。 在Myeclipse里新建一个web项目,导入shopping项目即可,数据库在db文件夹里
本例子经过修改,配置,组装成了一个可直接部署运行,不需要修改的demo,是学习spring ibatis struts 的一个非常好的例子。绝对好东西!!尽情下吧!!!
spring自带的JPetStore,我已经配置好(数据库也配置好,用的是hsqldb),可以直接导 入eclipse中运行。共3个压缩包
NULL 博文链接:https://ritaleo.iteye.com/blog/723394
JPetStore 6是基于MyBatis 3,Spring 3和Stripes构建的完整Web应用程序。 可以在MyBatis项目站点的下载部分下载。 在本节中,我们将逐步浏览该示例以了解其构建方式并学习如何运行它。 请参阅: : 与Tomcat 7...
HEAD MyBatis JPetStore JPetStore 6 是一个完整的 Web 应用程序,构建在 MyBatis 3、Spring 3 和 Stripes 之上。 它可以在 MyBatis 项目站点的下载部分下载。 在本节中,我们将遍历此示例以了解它是如何构建的并...
这是使用Struts+Spring+Hibernate实现jpetstore的功能的源代码
spring的jpetstore实例,可以直接用myeclipse打开的工程,里面含有建数据库的文件。
spring jpetstorespring jpetstorespring jpetstorespring jpetstorespring jpetstorespring jpetstore
该jpetstore经典案例为最新SPRING开发包里面的完全案例,并集成到eclipse里面了,在eclipse里面可以直接运行并调试,在工作目录里面直接建立jpetstore目录,自动导入该目录下文件,修改jdbc.properties配置文件,连接...
iBATIS_JPetStore-4.0.5
jpetstore-3-1-1
在原有的JPetStore5.0的基础上修改,数据持久层用hibernate替换原有的ibatis;添加Spring框架。
mybatis-spring-boot-jpetstore 该示例是一个基于MyBatis,Spring Boot(Spring MVC,Spring Security)和Thymeleaf的Web应用程序。 这是MyBatis JPetStore示例应用程序( )的另一种实现。 原始应用程序可在...
NULL 博文链接:https://tgwall163.iteye.com/blog/1219314