* [JAVA-13854] added parent module * [JAVA-13854] moved apache-tapestry(submodule) to web-modules(parent) * [JAVA-13854] moved bootique(submodule) to web-modules(parent) * [JAVA-13854] moved dropwizard(submodule) to web-modules(parent) * [JAVA-13854] moved blade(submodule) to web-modules(parent) * [JAVA-13854] moved java-lite(submodule) to web-modules(parent) * [JAVA-13854] moved jooby(submodule) to web-modules(parent) * [JAVA-13854] moved linkrest(submodule) to web-modules(parent) * [JAVA-13854] moved ninja(submodule) to web-modules(parent) * [JAVA-13854] moved ratpack(submodule) to web-modules(parent) * [JAVA-13854] moved resteasy(submodule) to web-modules(parent) * [JAVA-13854] moved restx(submodule) to web-modules(parent) * [JAVA-13854] moved spark-java(submodule) to web-modules(parent) * [JAVA-13854] moved vraptor(submodule) to web-modules(parent) * [JAVA-13854] delete modules that were moved * [JAVA-13854] * [JAVA-13854] * [JAVA-13854] delete ninja submodule + moved raml(submodule) to web-modules(parent) * [JAVA-13854] moved gwt(submodule) to web-modules(parent) * [JAVA-13854] moved jakarta-ee(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets-2(submodule) to web-modules(parent) * [JAVA-13854] moved jee-7(submodule) to web-modules(parent) * [JAVA-13854] moved play-framework(not a module) to web-modules * [JAVA-13854] fix failing test * [JAVA-13854] moved struts-2(submodule) to web-modules(parent) * [JAVA-13854] moved wicket(submodule) to web-modules(parent) * [JAVA-13854] deleted modules that were moved to web-modules * JAVA-13854 Removed moved modules from the main pom.xml Co-authored-by: panagiotiskakos <panagiotis.kakos@libra-is.com> Co-authored-by: Dhawal Kapil <dhawalkapil@gmail.com>
54 lines
1.6 KiB
Java
54 lines
1.6 KiB
Java
package controllers;
|
|
|
|
import play.libs.concurrent.HttpExecutionContext;
|
|
import play.mvc.*;
|
|
import play.twirl.api.Html;
|
|
|
|
import javax.inject.Inject;
|
|
import java.util.concurrent.CompletionStage;
|
|
|
|
import static java.util.concurrent.CompletableFuture.supplyAsync;
|
|
|
|
/**
|
|
* This controller contains an action to handle HTTP requests
|
|
* to the application's home page.
|
|
*/
|
|
public class HomeController extends Controller {
|
|
|
|
/**
|
|
* An action that renders an HTML page with a welcome message.
|
|
* The configuration in the <code>routes</code> file means that
|
|
* this method will be called when the application receives a
|
|
* <code>GET</code> request with a path of <code>/</code>.
|
|
*/
|
|
public Result index() {
|
|
return ok(views.html.index.render());
|
|
}
|
|
|
|
public Result writer(String author) {
|
|
return ok("Routing in Play by " + author);
|
|
}
|
|
|
|
public Result viewUser(String userId) {
|
|
final String response = String.format("Got user id {} in request.", userId);
|
|
return ok(response);
|
|
}
|
|
|
|
public Result greet(String name, int age) {
|
|
return ok("Hello " + name + ", you are " + age + " years old");
|
|
}
|
|
|
|
public Result squareMe(Long num) {
|
|
return ok(num + " Squared is " + (num * num));
|
|
}
|
|
|
|
public Result writer(String author, int id) {
|
|
return ok("Routing in Play by: " + author + " ID: " + id);
|
|
}
|
|
|
|
public Result introduceMe(String data) {
|
|
String[] clientData = data.split(",");
|
|
return ok("Your name is " + clientData[0] + ", you are " + clientData[1] + " years old");
|
|
}
|
|
}
|