form.fill() 在一个项目中不工作,在另一个项目中工作正常

form.fill() not working in one project, works fine in another

我有 2 个项目,名称为:

我在 "old" 中制作了一个带有单选按钮和一些文本字段的表单,用于输入年龄、体重... 然后我做了一个新项目(activator new new)并进一步开发了表格。控制器预填表格,预选单选按钮等。 现在我想更新 "old" 并将代码从 "new" 复制到 "old"。 在所有控制器中-类,在所有模型中-类,在所有视图中-类 是完全相同的代码!我什至多次手动检查文件大小,但在 "old" 中,表格没有预先填写!无论我做什么,都没有任何反应。我不知道为什么会这样,也不知道该怎么办。

我的代码:

Application.java:

package controllers;

import models.User;
import play.data.Form;
import play.mvc.Controller;
import play.mvc.Result;

public class Application extends Controller {

    static Form<User> userForm = Form.form(User.class);

    public static Result index() {

        User user = new User();
        Form<User> preFilledForm = userForm.fill(user);

        return ok(views.html.index.render(preFilledForm));
    }
}

User.java:

package models;

public class User {
    public Integer gewicht;
    public Integer groesse;
    public Integer alter;

    public Float grundUmsatz;

    public String geschlecht = "Mann";

    public User(){
        gewicht = 0;
        groesse = 0;
        alter = 0;
        geschlecht = "Mann";
    }
}

index.scala.html:

@(userForm : Form[User])

@import helper._
@import helper.twitterBootstrap._

@main("App - index") {

    @helper.form(action = routes.Application.submit(), 'id -> "userForm"){
        <fieldset>
            @helper.inputRadioGroup(
            userForm("Geschlecht"),
            options = options("Mann"->"Mann","Frau"->"Frau"),
            '_label -> "Gender",
            '_error -> userForm("Geschlecht").error.map(_.withMessage("select gender"))
            )
        </fieldset>

        @helper.inputText(userForm("Gewicht"))
        @helper.inputText(userForm("Groesse"))
        @helper.inputText(userForm("Alter"))
        <input type="submit" class="btn primary" value="Send">
    }
}

main.scala.html:

@(title: String)(content: Html)

<!DOCTYPE html>

<html>
    <head>
        <title>@title</title>
        <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
        <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
        <script src="@routes.Assets.at("javascripts/hello.js")" type="text/javascript"></script>
    </head>
    <body>
        @content
    </body>
</html>

路线文件:

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET     /                           controllers.Application.index()
POST    /auswertung/                controllers.Application.submit()

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

Peanut让我想起了activator clean,然后是activator run。似乎我在这方面工作的时间太长了,看不到解决方案。谢谢你的提醒!