日期:2014-05-20 浏览次数:20676 次
public class Users extends Controller { public static void show(String id) { User.findById(id); render(); } public static void save(User [color=red]user[/color]) { System.out.println(user.name); user.save(); render(); } }
@Entity public class User extends Model { public String name; public String account; }
#{extends 'main.html' /} <form action="@{Users.save()}" method="GET"> <input type="text" name="[color=red]user[/color].name" /> <input type="text" name="[color=red]user[/color].account" /> <input type="submit" value="Say hello!" /> </form>
<html> <head> </head> <body> save success </body> </html>