post-redirect-get 带有有关更新的通知
我们通常遵循在每次发布后进行重定向的惯例,理想情况下这是非常干净的。但通常需要向用户提供有关更新内容的反馈。
当我发表一篇文章,然后进行 get 时,我想显示同一页面,并显示有关已完成更新的通知,这使得 GET 对于正在更新的内容的额外状态非常笨拙。我在这里错过了什么吗?
We usually follow the convention of doing a redirect after every post, which is ideally very clean. But usually there is a requirement to give the user feedback about what has been updated.
When i do a post followed by get i wanna show the same page with the notification about the updation being done, which makes the GET very clumsy with the extra status of whats being updated. Am i missing something here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
值得商榷的。
......这就是主要原因之一。
尝试通过会话传递事务数据是一种非常糟糕的做法。
我使用的解决方案是对表单序列使用前端控制器(而不是整个站点的前端控制器!),但通常会尝试避免出现要发布一系列表单的情况
debatable.
...and that's one of the main reasons why.
Trying to pass transactional data via the session is a very bad practice.
The solution I've used is to use a front controller for sequences of forms (not a front controller for the whole site!) but in general trying to avoid the scenario where there is a sequence of forms to be posted