Deploying Newly Created Apps a Snap

By Jeff Cogswell  |  Posted 2012-06-11 Print this article Print

I chose the Cloud Foundry servers and provided my username and password that I€™d been given in the introductory email. Then a message box popped up to remind me that I needed to change my password, just as the email said I would have to do. But I was able to do it all from within Eclipse, without even installing the command-line tools.

The next step was to build an actual Web application. I created a new Dynamic Web project in Eclipse, and created a JavaServer Pages (JSP) file called index.jsp, and a servlet file that contained Java code. Neither contained much; the index.jsp file just contained a €œHello Cloud Foundry!€ message with a link called Run Servlet. That link opens the servlet page, which in turn displays a message €œHello Cloud Foundry Servlet.€

After that, I was pleasantly surprised with the deployment procedure. Typically deploying a Web application in other platforms is a bit of a headache. Tools such as Microsoft Visual Studio include publishing features that are a bit clunky. But here, deployment was a snap. I double-clicked the entry in the Server window for Cloud Foundry, which opened a window containing information about my server (including buttons for connecting, changing password and disconnecting).

I was already connected, so I didn€™t need to connect again. At the bottom of that window is an Applications tab. I clicked that, which presented me with an empty list box. Then I used the mouse and dragged the project name in the Project Explorer window right onto the list box.

A window opened asking for the application name (you can change it for the remote server, but I chose not to) and the application type (the options are Spring, Lift, Grails and Java Web). I clicked Next, and it wanted a URL that ends with I put in €œ€

The application uploaded, but I then saw a message that it couldn€™t launch because the name €œhellocloudfoundry€ was already taken. So I right-clicked the application and deleted it from the server and tried again. I went through the same process, but this time chose the name Then I saw a console open at the bottom showing me details of the application starting up.

But was it really live? I wasn€™t sure, but there was a link next to the list box with my URL, so I clicked it. A Web browser opened inside Eclipse and, lo and behold, there was my index.jsp rendered inside the browser. But just to be sure, I left Eclipse and went to my Chrome browser and put that same URL in. Sure enough, I was looking at my JSP page I€™d created earlier.

Jeff Cogswell is the author of Designing Highly Useable Software ( among other books and is the owner/operator of CogsMedia Training and Consulting.Currently Jeff is a senior editor with Ziff Davis Enterprise. Prior to joining Ziff, he spent about 15 years as a software engineer, working on Windows and Unix systems, mastering C++, PHP, and ASP.NET development. He has written over a dozen books.

Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel