Learn Java for Web Development

(Tina Meador) #1

360 CHAPTER 8: Play with Java and Scala


You can also get some help by executing the help command, as illustrated in Figure 8-4.



play help



Figure 8-4. Help in Play 2


Figure 8-5. Creating the helloworld application


Figure 8-6. Specifying whether the application is a Scala or Java application


Now you can create your first Java web application with Play. Let’s Play!


Hello World Java Application with Play

To create a new application, you just have to use the play command-line tool with the parameter new
followed by the name of the new application, in this case helloworld, as illustrated in Figure 8-5.


Play 2 will ask you to specify whether your application is a Scala or Java application, as illustrated
in Figure 8-6.

Free download pdf