Virgo运行Greenpages案例

9 篇文章 0 订阅
2 篇文章 0 订阅

1 安装Virgo tomcat server

下载

解压缩到D:\virgo-tomcat-server-3.5.0.RELEASE下,运行其下bin\startup.bat可以启动服务器。

 

2 安装Apache Marven

http://maven.apache.org

 

3 Greenpages简介

 

GreenPages is a simple application that allows users to search an online email address directory. Each listing in the directory details the relevant email addresses and the name of the owner. GreenPages has only three screens: the search screen, the results screen and the listing detail screen.

In the search screen, users can enter search criteria to be matched against the listings in the directory. The result screen displays any listings that match the criteria entered by the user. The listing detail screen shows all the data known about a given listing.

Despite its simplicity, GreenPages is designed to demonstrate many different Virgo Tomcat Server features and to act as a template from which other modular applications can be built. In particular, GreenPages demonstrates:

  • bundle dependencies with Import-Package,

  • load-time weaving with JPA and AspectJ,

  • bundle classpath scanning, and

  • service export, lookup and injection.

In addition to demonstrating common Virgo Tomcat Server features, GreenPages demonstrates integration with:

  • Spring Framework 3.0;

  • FreeMarker 2.3;

  • EclipseLink 1.0.0;

  • H2 1.0.71; and

  • Commons DBCP 1.2.2.

The GreenPages application is packaged as a PAR file containing four bundles.

The greenpages.db bundle provides access to an external database and publishes a javax.sql.DataSource service.

The greenpages.app bundle exports a greenpages package containing Directory and Listing interfaces.

The greenpages.jpa bundle imports the greenpages package and uses the javax.sql.DataSource service to access the external database and publishes its contents as a greenpages.Directory service.

The greenpages.web web application bundle imports the greenpages package and uses the greenpages.Directory service to respond to web requests.

(来源:http://www.eclipse.org/virgo/documentation/greenpages-documentation-2.5.0.RELEASE/docs/htmlsingle/greenpages-guide.html

 

4 安装Greenpages

下载Greenpages最新版,2.5版;解压缩后文件夹结构如:

d:\greenpages-2.5.0.RELEASE\db,....

 

5 编译

进入DOS命令符

d:\greenpages-2.5.0.RELEASE>mvn package

大约花费6分多钟,出现所有项目Success后,

在d:\greenpages-2.5.0.RELEASE\greenpages会出现target文件夹。

 

6 数据库参数设置

d:\greenpages-2.5.0.RELEASE> cd db

d:\greenpages-2.5.0.RELEASE\db> run

浏览器出现参数设置窗口,用默认值,关闭该窗口

d:\greenpages-2.5.0.RELEASE\db> data

 

7 部署

拷贝d:\greenpages-2.5.0.RELEASE\greenpages\target\greenpages-2.5.0.RELEASE.par文件到D:\virgo-tomcat-server-3.5.0.RELEASE\pickup下。

 

8 测试

Dos下进入D:\virgo-tomcat-server-3.5.0.RELEASE\bin下,运行命令startup -clean

在浏览器中,访问http://localhost:8080/greenpages/app/home.htm

输入参数on,查询看结果。

 

运行正常

 

疑问:数据库参数设置后,其连接参数及创建的数据难道写入.par文件中了?否则,为什么拷贝.par文件后数据已存在于数据库中了?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值