Skip to content

Instantly share code, notes, and snippets.

@1206yaya
Created January 19, 2015 02:23
Show Gist options
  • Save 1206yaya/0d313e16fd1f5c544b12 to your computer and use it in GitHub Desktop.
Save 1206yaya/0d313e16fd1f5c544b12 to your computer and use it in GitHub Desktop.
playJava 全件取り出し
// Finder用の内部クラス
public static class FindForm {
@Required
public String input;
}
// /findにアクセスした際のAction
public static Result find() {
Form<FindForm> f = new Form(FindForm.class).bindFromRequest();
List<Message> datas = null;
if (!f.hasErrors()) {
datas = Message.find.where().findList();
}
return ok(find.render("投稿の検索", f, datas));
}
@(msg: String, form1: Form[Application.FindForm], datas: List[Message])
@main("Sample Page") {
<h1>delete data</h1>
<p>@msg</p>
@helper.form(action = routes.Application.find) {
@(helper.inputText(field = form1("input")))
<input type="submit">
}
<hr>
<p>@datas</p>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment