It's alive and not empty!

In the earlier sections we saw how to create a project, import it into our development environment, and we even learned how to attach new libraries to it.

Now it's time to look at what has been created so far. As we've chosen not to create an empty project (which was the third option proposed by the play new command), we already have a certain amount of things available for our perusal.

Rather than looking at the files, we are going to run the application using a play command to compile everything and start a server that will run our application.

To do this, enter the play! console and type run:

It's alive and not empty!

As we can see, the console tells us that it has started the application and an HTTP server is available on port 9000.

The next logical step is to open our browser and request this brand new server by going to the URL http://localhost:9000/.

Once done, our page should look like the following screenshot:

It's alive and not empty!

What is being shown is the default welcome web page that Play! 2 has made available for us.

As shown in the previous screenshot, this page already contains a lot of information, essentially the basics (that we'll cover next) and some help about the environment (which we've just covered).

Recall that when we installed Play!, the Play! Framework 2 installation directory contained a documentation folder. Now that we have an application running, we'll see that this documentation wasn't there for no reason.

If we pay more attention to the welcome page, there is a Browse menu on the right side of the page. This menu has two items. Let's have a quick overview of them now.

The first item, Local documentation, is a reference to the manual folder of our installation. So we can access the current Play! version's documentation directly from our application (at development time only, not in production).

The second item is the API and is discussed in the next section.

Browsing the Java API

Before entering into any details, we must have noted that the menu has the word Java in its name. That's because Play! has detected (we'll see how later) that we're running a Java application.

On entering this menu, we'll see the following web page:

Browsing the Java API

As expected, we obtained the well-known Javadoc website. We won't cover the API here, but the good thing to note is that we'll always have direct access to it without having to generate it, browse the Web to find it, and so on.

Note

This kind of website is also available for the Scala version, but it has a slightly different presentation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset