`
wutao8818
  • 浏览: 607032 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

重头开始学 Spring JPetStore 2

阅读更多
2. BUILD AND DEPLOYMENT

编译和发布

This directory contains the web app source.
For deployment, it needs to be built with Apache Ant.
The only requirements are JDK >=1.3 and Ant >=1.5.

这个目录包含了web程序的源代码。发布需要Apache Ant 构建。唯一的要求是
JDK版本 高于1.3 Ant 版本高于1.5

Run "build.bat" in this directory for available targets (e.g. "build.bat build",
"build.bat warfile"). Note that to start Ant this way, you'll need an XML parser
in your classpath (e.g. in "%JAVA_HOME%/jre/lib/ext"; included in JDK 1.4).

运行build.bat带上有效的目标,例如build.bat build , build.bat warfile 。必须注意的是XML 解析器 必须在classpath 里面,例如%JAVA_HOME%/jre/lib/ext

You can use "warfile.bat" as a shortcut for WAR file creation.
The WAR file will be created in the "dist" directory.

你能使用warfile.bat作为一个快捷方式构建一个war文件。war文件将被创建在dist目录。


To execute the web application with its default settings, simply start the
HSQLDB instance in the "db/hsqldb" directory, for example using "server.bat".
For other databases, you'll need to use the corresponding schema and load scripts
in the "db" subdirectories (same as with the original JPetStore). In the local
case, the JDBC settings can be adapted in "WEB-INF/jdbc.properties". With JTA,
you need to set up corresponding DataSources in your J2EE container.

以这个web应用的默认设置执行,简单的启动在db/hsqldb目录中的HSQLDB实例,例如使用"server.bat".如果要使用其他数据库,你将需要使用相应的schema 和加载脚本在db子目录中。在本地情景中,在WEB-INF/jdbc.properties中设置JDBC配置使用。如果要使用JTA,你需要在J2EE 容器中设置相应的数据源。

Note that the "WEB-INF/dataAccessContext-*.xml" files might have to be adapted
for certain databases like MS-SQL and Oracle, to use appropriate generation
strategies for order IDs. See the corresponding commented-out DAO definitions
in the context XML files. WARNING: As of Spring 1.0 M4, only HSQLDB will be
properly tested. We are happy to accept any feedback on other databases.

注意WEB-INF/dataAccessContext-*.xml文件也许需要为某些数据库,例如MS-SQL and Oracle 提供适配器,以使用合适的序列ID生成策略。查看相应的在上下文XML文件中注释掉的DAO定义。注意:在Spring 1.0 M4,只有HSQLDB 被合适的测试过。我们很高兴接受任何的其他数据库的反馈。

A guide to step-by-step deployment, assuming JDK 1.4.x and Tomcat 4.x:
1. if not already set, set the JAVA_HOME environment variable
2. run "ant warfile" respectively "warfile.bat" to generate the WAR file
3. copy the generated "dist/jpetstore.war" to Tomcat's "webapps" directory
4. start HSQLDB via "db/hsqldb/server.bat" respectively "server.sh"
5. start Tomcat (default port will be 8080)
6. open "http://localhost:8080/jpetstore" in an Internet browser

If you want to test remote service access:
1. create an order with the JPetStore web UI (first order number will be 1000)
2. adapt server URL in "client/client.properties" (if not using the default)
3. switch to the "client" directory as execution directory
4. run "client.bat 1000" to fetch and show the order with number 1000
5. run "client.bat 1000 10" to fetch the order 10 times per protocol

一个手把手部署的指导,假设JDK 1.4.x Tomcat 为4.x
1.如果没有设置,请设置JAVA_HOME 环境变量。
2.运行"ant warfile" 各自的"warfile.bat" 来生成WAR 文件
3.拷贝生成的"dist/jpetstore.war"到Tomcat的webapps目录
4.启动HSQLDB 通过db/hsqldb/server.bat 或者 "server.sh"
5.启动tomcat
6.打开浏览器 "http://localhost:8080/jpetstore"

如果你想测试远程服务访问
1.通过JPetStore web接口创建订单
2.在"client/client.properties" 配置服务器地址
3.切换到 "client" 目录作为执行目录
4.运行 "client.bat 1000"  获得并展示数据为1000的订单
5.运行 "client.bat 1000 10" 获得数据为1000的订单 10次
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics