Skip to content

Instantly share code, notes, and snippets.

@lrlucena
Created August 17, 2018 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrlucena/6b3191dfca4c57a012d2ebec77774f86 to your computer and use it in GitHub Desktop.
Save lrlucena/6b3191dfca4c57a012d2ebec77774f86 to your computer and use it in GitHub Desktop.
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("http://www.uol.com.br");
//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)
<html><head>
<title>Ola Mundo</title>
</head>
<body>
<h1 style="color:blue;">Funciona!!!</h1>
<h2>@s</h2>
@for(a<- 1 to 10){
<h3>@a</h3>
}
</body>
</html>
@*
@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