Spring MVC CRUD controller best pactice

后端 未结 1 1128
挽巷
挽巷 2021-02-06 14:25

I am trying to find a best practice approach for a Spring MVC simple CRUD controller. There are a lot of examples of CRUD controllers both on the web and on this forum, but most

相关标签:
1条回答
  • 2021-02-06 14:46
    1. You should use RESTful URL design, and use gEt to rEad, posT to creaTe, pUt to Update, and Delete to Delete. Use the HiddenHttpMethodFilter for user agents that don't PUT or DELETE.

    2. Use the Post-Redirect-Get pattern to avoid re-POSTs.

    3. Use Flash Attributes to show Success/Failure messages on subsequent pages.

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