bindFormRequest()在Play 2.0.3中遇到无法找到的符号错误

Rya*_*yan 3 java forms heroku playframework playframework-2.0

我用Play框架创建了一个表单.但我得到了一个error: cannot find symbol 我在播放目录中查看的示例代码,仍然无法搞清楚.顺便说一句,我可以使用Play访问heroku中的PostgresSQL吗?这是以下代码:

这是/controllers/Application.java中的一段代码

    final static Form<Geo> geoForm = form(Geo.class);

    public static Result showDBpage(){

          //get problem here :-<
          Form<Geo> filledForm = geoForm.bindFormRequest(); 
          Geo loc = filledForm.get();
          return ok(database.render(loc));
        }
Run Code Online (Sandbox Code Playgroud)

这是conf/routes:

POST    /database   controllers.Application.showDBpage()
Run Code Online (Sandbox Code Playgroud)

意见/ database.scala.html

@(loc: Geo)

@main("") {

    <p>This is Database pages</p>

    <p>@loc.longitute and @loc.latitute</p>

    <a href=@routes.Application.index>Back to form</a>
}
Run Code Online (Sandbox Code Playgroud)

车型/ Geo.java:

package models;

import java.util.*;
import javax.validation.*;
import play.data.validation.Constraints.*;

public class Geo
  {
    @Required
    public String longitute;
    @Required
    public String latitute;

    public Geo()
    {

    }

    public Geo(String longitude,String latitute)
    {
        this.longitute = longitute;
        this.latitute = latitute;
        //this.length = length;
    }
  }
Run Code Online (Sandbox Code Playgroud)

bie*_*ior 7

没有方法bindFormRequest()但是bindFromRequest()- 你的代码中有一个拼写错误.

查看API http://www.playframework.org/documentation/api/2.0.2/java/play/data/Form.html