前提・実現したいこと
playframeworkでフォームの作成(playframework2徹底入門というほんのp32-p37の部分)
発生している問題・エラーメッセージ
value index is not a member of object controllers.Application
該当のソースコード
# Routes # This file defines all application routes (Higher priority routes first) # ~~~~ # Home page GET / controllers.Application.index() # Map static resources from the /public folder to the /assets URL path GET /assets/*file controllers.Assets.at(path="/public", file)
package controllers; import play.*; import play.data.*; import static play.data.Form.*; import play.mvc.*; import views.html.*; public class Application extends Controller { public String message; public Result index() { return ok(index.render("何か書いて",new Form(SampleForm.class))); } public static class SampleForm{ public Result send(){ Form<SampleForm> f=form(SampleForm.class).bindFromRequest(); if(!f.hasErrors()){ SampleForm data=f.get(); String msg="you typed:"+data.message; return ok(index.render(msg,f)); }else{ return badRequest(index.render(ERROR),form(SampleForm.class)); } } } }
試したこと
何がおかしいのかがウェブで調べてもよくわかりませんでした。
playframework初心者で、よくわからないのですが、playアプリケーションを作成して、はじめにroutesを開いたときからGETの部分にエラーが表示されていました。
補足情報(FW/ツールのバージョンなど)
ちなみにplay-2.2.4を使っています
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。