Skip to content

Instantly share code, notes, and snippets.

@mguillermin
Created March 14, 2012 09:19
Show Gist options
  • Save mguillermin/2035314 to your computer and use it in GitHub Desktop.
Save mguillermin/2035314 to your computer and use it in GitHub Desktop.
Play 2.0 Java Controller Sample
public class Application extends Controller {
public static Result testText() {
return ok("Hello world !");
}
public static Result testTemplate() {
return ok(index.render("Your new application is ready."));
}
public static Result testNotFound() {
return notFound("Could not find this page !");
}
public static Result testRedirect() {
return redirect(controllers.routes.Application.testText());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment