📜  spring 形式的路径 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:04.199000             🧑  作者: Mango

代码示例1
// The path attribute is bound into java properties using java beans convention.
// For example for following form:

  Name: 
  Cool?: 
  

// And following controller handler method:
@RequestMapping(...)
public String updateStudent(@ModelAttribute("theStudent") Student student) {
  // ...
}
// Will bind automatically if the Student class is defined with following properties:
public class Student {
  private String name;
  public String getName() { return this.name; }
  public void setName(String name) { this.name = name; }

  private boolean cool;
  public boolean isCool() { return this.cool; }
  public void setCool(boolean cool) { this.cool = cool; }
}