пытается использовать встроенный валидатор springboot с freemarker для проверки правильности ввода или нет.но я получил ошибку ftl на моей первой странице.код, показанный ниже: pojo
@Entity
@Table(name = "customer"/*, indexes = {@Index(name = "INX_CUSTOMER_NO", columnList = "no")}*/)
public class CustomerEntity extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
Long id;
@Column(name = "name")
@NotBlank(message = "{notBlank}")
String name;
контроллер
@RequestMapping(value = "/static/cust_add.html",method = {RequestMethod.GET,RequestMethod.POST})
public ModelAndView add(@Valid CustomerEntity cust, BindingResult bindingResult, RedirectAttributes redirectAttributes){
ModelAndView mv = new ModelAndView();
redirectAttributes.addFlashAttribute("cust", cust);
mv.setViewName("/static/cust_add");
return mv;
}
ftl
<form action="/crm/static/cust_check.html" class="form-ajax-file">
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="4" bordercolor="#666666">
<tr>
<td colspan="2" bgcolor="#eeeeee">add customer info</td>
</tr>
<tr>
<td width="150" align="right">customerName:</td>
<td>
<@spring.bind "cust.name"/>
<input type="text" id="name" class="tr-width"/>
</td>
<td><@spring.showErrors ""/></td>
</tr>
</table>
</form>
и ошибка
FreeMarker template error (DEBUG mode; use RETHROW in production!): The following has evaluated to null or missing: ==> spring [in template "static/cust_add.ftl" at line 20, column 19] ----
действительно нужна помощь