Java Reference
In-Depth Information
Figure
8-9
illustrates the default Play 2 welcome page. The default welcome page of the application
is a great source of information for a beginner, and it is recommended that you read it.
The
run
command creates the structure of the application inside the
helloworld
directory. The
structure is illustrated in Figure
8-10
.
Figure 8-10.
The directory structure of the helloworld application
Each folder in Figure
8-10
is described here:
app
: This is the root of all the server-side source files such as Java and Scala
source code, templates, and compiled assets' sources. At creation, only two
subfolders will be created:
controllers
and
views
for the controller and view
components, respectively, of the MVC architectural pattern. You can add the
directory
app/models
for the model component of the MVC. There is also an
optional directory called
app/assets
for compiled assets such as LESS
5
sources
and CoffeeScript
6
sources.
conf
: The
conf
directory contains the application's configuration files meant to
configure the application itself, external services, and so on. There are two main
configuration files:
application.conf
: The main configuration file for the application, which contains
standard configuration parameters
routes
: The routes definition file
project
: The project folder is meant to contain all of the necessary files to
configure the Scala build tool SBT.
7
public
: This directory contains three standard subdirectories for images, CSS
style sheets, and JavaScript files.
5
6
7