Spring MVC how to forbid data binding to ModelAttribute?

后端 未结 1 1452
清酒与你
清酒与你 2021-02-05 12:21

I have a simple @Controller class that renders a page after user has logged in:

@Controller
@SessionAttributes(\"user\")
public class DashBoardContr         


        
1条回答
  •  悲&欢浪女
    2021-02-05 12:52

    There is an attribute of @ModelAttribute called binding which you can set to false to disable binding of request parameters. Usage: @ModelAttribute(binding=false) before method parameter.

    Reference: click

    0 讨论(0)
提交回复
热议问题