Deploying Newly Created Apps a Snap
I chose the Cloud Foundry servers and provided my username and password that Id 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 didnt 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 cloudfoundry.com. I put in hellocloudfoundry.cloudfoundry.com.
The application uploaded, but I then saw a message that it couldnt 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 eweek1.cloudfoundry.com. Then I saw a console open at the bottom showing me details of the application starting up.
But was it really live? I wasnt 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 Id created earlier.