Edit method with Spring Boot problem

0

I created a project in Spring Boot with ThymeLeaf and I'm having problems in the implementation that makes updating of the bank records, the application is managing to save the records, it's getting validate the fields now only missing the registry editing implementation of the bank.

After I can save the records it gives me a hit screen right at the top of the screen, and then I go to the bank record listing screen as you can see below;

WhenIclickonthepenicontoedit,itreturnstotheregistrationscreenbeingwiththedatanodesretrievedforediting,beingthatatthetimeofsubmittingtheformitcannotsave,andtheeditingscreenalsofailsvalidatethefieldsifthereisafieldinwhites,howtosolvethis?

Thisisthemethodofediting;

@RequestMapping("/pesquisa/{codigo}")
public ModelAndView edicao(@PathVariable("codigo") Boleto boleto) {
    ModelAndView mv = new ModelAndView("boleto/CadastroBoleto");
    mv.addObject(boleto);
    return mv;
}

on the search page is this part;

<a class="btn btn-link btn-xs" th:href="@{/boleto/pesquisa/{codigo}(codigo=${boleto.codigo})}" 
                                       title="Editar" rel="tooltip" data-placement="top">
                                   <span class="glyphicon glyphicon-pencil"></span>
                               </a>

I'm not seeing anything wrong, I even tried to use the Spring Boot debug, but it crashes my development platform in a way that I'm unable to use it.

The debug I'm referring to would be in the application.properties file

logging.level.root=debug

I do not know if I put the parts that would be necessary for someone to help me, so I'm making my complete project available to anyone who wants to ask questions and wants to see other parts that are relevant to help me in the project.

link

    
asked by anonymous 30.11.2016 / 12:42

1 answer

0

I think you've already been able to solve the problem. If not, to edit you are passing the ticket id, but in the controller you do not get this id.

In my project I did the following and it works perfectly:

@GetMapping("/edit/{id}")
public ModelAndView edit(@PathVariable("id") Long id) {

    return add(userService.findOne(id));

}
    
12.04.2017 / 22:29