Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Web 17/08/2018
package controllers;
import play.mvc.*;
* This controller contains an action to handle HTTP requests
* to the application's home page.
public class HomeController extends Controller {
public Result index() {
// return redirect("");
//return ok("<html><body>Funciona!</body></html>");
return ok(views.html.index.render("Ola Mundo"));
public Result olatads() {
return ok("Ola TADS");
public Result soma(Integer a, Integer b) {
return ok("Soma = " + (a + b));
@(s: String)
<title>Ola Mundo</title>
<h1 style="color:blue;">Funciona!!!</h1>
@for(a<- 1 to 10){
@main("Welcome to Play") {
<h1>Welcome to Play!</h1>
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# An example controller showing a sample home page
GET / controllers.HomeController.index
GET /olatads controllers.HomeController.olatads
GET /soma/:a/:b controllers.HomeController.soma(a: Integer, b: Integer)
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment