Created
January 19, 2015 02:23
-
-
Save 1206yaya/0d313e16fd1f5c544b12 to your computer and use it in GitHub Desktop.
playJava 全件取り出し
This file contains 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
// 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)); | |
} |
This file contains 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
@(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