Technologies used in this article :

  1. Spring Tool Suite (STS) 3

  2. Cloud Foundry Integration Extension for STS

  3. AppFog PaaS

Download :

1. Create a Dynamic Web Project

Create a dynamic web project (say 'AFHello') with a jsp page (say 'afHello.jsp'). We'll deploy this web application to AppFog Cloud Platform.

Related Posts

File : afHello.jsp

 

2. Install Cloud Foundry Integration Extension

Install Cloud Foundry Integration Extension in Eclipse or Spring Tool Suite (STS) IDE

 

3. Define a new server

Click File --> New --> Other --> Server --> VMware --> Cloud Foundry

Define a new server
Cloud Foundry Account

 

4. Add AppFog cloud url

Click 'Manage Cloud' --> 'Add'. Enter the AppFog cloud url 'https://api.appfog.com' and click the 'Finish' button.

Manage Cloud Url
Add Cloud url

 

5. Configure AppFog Account

Enter AppFog account's email, password and select App Fog Cloud as url. Click the 'Validate Account' button to check whether all the configurations are correct ot not. Click 'Finish' button.

Configure AppFog Account

 

6. Deploy Application

Drag your application and drop it to the 'App Fog Cloud' server. Provide 'Application Details' and click 'Next' button.

Application Details

In 'Launch Deployment' window provide deployed url (for example 'afhello.aws.af.cm').

Launch Deployment
Note:
Deployed url needs to be unique and it is comprised of two parts - subdomain (eg. afhello) and infrastructure (Amazon Web services - aws.af.cm) where we want to deploy our application. AppFog provides different OpenStack-based IaaS like Rackspace or HP to AWS. As of now, following infrastructures are provided by AppFog PaaS
  1. AWS Asia Southeast (.ap01.aws.af.cm)
  2. AWS Europe West (.eu01.aws.af.cm)
  3. AWS US East (.aws.af.cm)
  4. HP Openstack AZ 2 (.hp.af.cm)
  5. Rackspace DFW (.rs.af.cm)
Deployed Application

If the url is already used by any other AppFog user then you can change the same using the 'Edit' button of 'Mapped Url'

 

7. Browser output

Open the mapped url ('afhello.aws.af.cm') in the browser.

Browser output

 

Download Source Code

SrcCodes : AFHello.zip

 

References