我有 4 种类型的请求,由 4 种不同的方法处理AccountsController
:
/accounts
显示所有帐户/accounts/new
新帐户页面/accounts/{accountId}/edit
编辑帐户页面/accounts/{accountId}/delete
删除帐户
(1)
很好。我只是返回DisplayAccounts.jsp
视图。
关于(2)
and (3)
,当我将用户从初始视图带到DisplayAccounts.jsp
(一旦操作成功)时,URL 仍然是旧的(或者/accounts/new
或/accounts/{accountId}/edit
分别)
并且(4)
,我没有开始的看法。这只是一个动作,它应该返回EditAccount.jsp
对失败和DisplayAccounts.jsp
成功的看法。再一次,最终的 URL 应该是/accounts/{accountId}/edit
或/accounts
分别。
我该如何做到这一点?