I have the following form:
public class ChildcareWorkerAdvertisementForm extends AbstractForm<ChildcareWorkerAdvertisement> {
@Valid
@Override
public ChildcareWorkerAdvertisement getModel() {
return super.getModel();
}
}
I would like to rename the property with the name modelto something else, possibly advertisementwhen the binding happens, so that I can refer to it as advertisementin the view (thymeleaf, etc.).
Is this possible with Spring MVC?
edit 1 : here is my application ' AbstractFormclass:
package com.bignibou.web.controller;
public class AbstractForm<T> {
private T model;
public T getModel() {
return this.model;
}
public final void setModel(T model) {
this.model = model;
}
...
You can see that it uses Generics, which is very neat in the java part. However, I would like to customize the property name modelin the views, hence my question.
source
share