8. # Default path will just redirect to the computer list
GET / controllers.Application.index
# Computers list (look at the default values for pagination parameters)
GET /computers controllers.Application.list(p:Int ?= 0, s:Int ?
= 2, f ?= "")
# Add computer
GET /computers/new controllers.Application.create
POST /computers controllers.Application.save
# Edit existing computer
GET /computers/:id controllers.Application.edit(id:Long)
POST /computers/:id controllers.Application.update(id:Long)
VERB route reverse
Routing
10. ● "You don’t have to write complicated Scala
code here" – Play for Java developpers
● @foo.bar != @{foo.`type`}
● error: No implicit Ordering
defined for Foo
foos.sorted
Vues
11. "We simply want to
offer a minimal set
of helpers"
Bases SQL
12. ● Anorm par défaut. Minimal. Léger.
« Parfait pour les p'tites faims »
● Slick by Typesafe. Verbeux sans macro.
Bases SQL - Scala
13. ● Ebean. Très léger. Génère mauvais DDL
pour évolution.
● JPA.
○ Hibernate 4.0 (conversion JodaTime)
○ Import du module javaJpa
○ @Transactionnal & Akka
Bases SQL - Java
15. public class User {
@Required
public String email;
public String password;
public String validate() {
if(authenticate(email,password) == null) {
return "Invalid email or password";
}
return null;
}
}
:)
:(
Formulaires - côté modèles