Created
August 17, 2018 17:45
-
-
Save lrlucena/6b3191dfca4c57a012d2ebec77774f86 to your computer and use it in GitHub Desktop.
Web 17/08/2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(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> | |
} | |
*@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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