WhenIsubmittheformitgivesthiserroronscreen
This is a Spring Boot project, I thought I did not need a class to convert to the category combo, but as I gave the error message I resolve to create the class convert as you can see below;
import org.springframework.core.convert.converter.Converter;
import org.springframework.util.StringUtils;
import br.com.armazem.model.Categoria;
public class CategoriaConverter implements Converter<String, Categoria> {
@Override
public Categoria convert(String codigo) {
if (!StringUtils.isEmpty(codigo)) {
Categoria categoria = new Categoria();
categoria.setCodigo(Long.valueOf(codigo));
return categoria;
}
return null;
}
}
Even though it keeps generating error, what can I do?
I'm new Spring Boot programmer.