A Guide to the GreenPages Sample

Copyright © 2011 VMware Inc.

All rights reserved. This document is made available under the terms of the Eclipse Public License v2.0 which is available at http://www.eclipse.org/legal/epl-v20.html.

Java, Oracle are trademarks or registered trademarks of Oracle, Inc. in the United States and other countries.

OSGi is a trademark or a registered trademark of the OSGi Alliance in the United States, other countries, or both.

Eclipse is a trademark of Eclipse Foundation, Inc.

UNIX is a registered trademark of The Open Group.

Windows is a registered trademark of Microsoft Corporation in the United States and other countries.

Abstract

Spring application programmers are introduced to Virgo by installing the Virgo Tomcat Server and building and running a small application called GreenPages.

Despite its simplicity, GreenPages is designed to demonstrate many different Virgo features and to act as a template from which other modular applications can be built. This guide highlights areas of interest in the sample code.

This version of the guide is based on the following software versions:

GreenPages Sample2.5.0.RELEASE
Virgo Tomcat Server3.0.2.RELEASE
Apache Maven2.2.0


Table of Contents

1. Installing Pre-requisites
Installing a JDK
Installing Virgo Tomcat Server
Installing the Eclipse Tooling
Installing Apache Maven
2. Installing and Running GreenPages
Introduction
Obtaining GreenPages
Building and Installing GreenPages
Building with Apache Maven
Installing Dependencies into Virgo Tomcat Server
Starting and Configuring the Database
Installing and Starting GreenPages PAR
Browsing the GreenPages Application
Running GreenPages from Eclipse
Importing the GreenPages Projects into Eclipse
Configuring Virgo Tomcat Server Target Runtime
Running GreenPages from Within Eclipse
3. GreenPages Highlights
Web Application Bundle Highlights
web.xml
Controller Class
Component Scanning
Bundle Manifest
Service Injection
Middle Tier Highlights
DataSource
EntityManager
Transaction Management
Testing Highlights
Single Bundle Integration Test
Multi Bundle Integration Test
Automated Build Highlights
Building the PAR
Obtaining Dependencies
Automatically Running the Tests
A. Further Resources
Projects
Documentation