374 CHAPTER 8: Play with Java and Scala
Play cannot compile your routes file because it references actions that don’t exist. The next step is
to add these actions to the Application.java file.
Creating the Controller and Actions
In this section, you will create the actions, as illustrated in Listing 8-8.
Listing 8-8. Application Controller in the Books Application
- public class Application extends Controller {
- public static Result index() {
- return ok(index.render("Your new application is ready."));
- }
- public static Result books() {
- return TODO;
- }
Figure 8-21. Routes file compilation error