编译器错误:无法使用在播放框架中的路由中返回javax.xml.transform.Result作为Handler的方法

时间:2014-07-04 20:16:33

标签: java playframework routes playframework-2.2

controllers-> Students.java

public class Students extends Controller { 

        /* Create a new student form */

        public static Result create(){
            Form<Student> studentform = form(Student.class);
            return ok(createstudentform.render(studentform));
        }
        public static Result save(){
            Form<Student> studentform = form(Student.class).bindFromRequest();
            if(studentform.hasErrors()){
                return badRequest(createstudentform.render(studentform));
            }
            studentform.get.save();
            flash("success", "Student" + studentform.get().usn + "has been created");
            return ok(index.render("Your new application is ready."));
        }
}

路线:

# Home page
GET     /                           controllers.Application.index()

# Add a student

GET     /students/new              controllers.Students.create()
POST    /students                  controllers.Students.save()

# Map static resources from the /public folder to the /assets URL path
GET     /assets/*file               controllers.Assets.at(path="/public", file)

编译错误:

Cannot use a method returning javax.xml.transform.Result as an Handle

0 个答案:

没有答案