[MGNLCMNT-67] Posting comments should use the POST-REDIRECT-GET pattern Created: 20/Mar/12  Updated: 23/Mar/12  Resolved: 23/Mar/12

Status: Closed
Project: Commenting (closed)
Component/s: None
Affects Version/s: 1.2.1
Fix Version/s: 1.2.2

Type: Improvement Priority: Critical
Reporter: Tobias Mattsson Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
duplicates MGNLCMNT-63 Last comment duplicated when reloadin... Closed
Template:
Acceptance criteria:
Empty

 Description   

Adding a comment is done using a POST request, as a response the page is rendered with the new comment added.

If the user then tries to reload the page the browser will ask if the user really wants to resubmit form data. If the user agrees then the comment is added to the page again. If the user goes back using the back button he/she will also get the warning when using the forward button to return to the page. This also happens if the user navigates from the page with the comments and then goes back.

The commenting component should return a redirect when it has added the comment making the browser execute a GET request to see the page with the comment added. The POST and redirect don't become part of the history so the user can freely navigate back and forth and reload the page without the warning.

This should be trivial to implement using the model execution feature added in 4.4.



 Comments   
Comment by Tobias Mattsson [ 21/Mar/12 ]

Another problem is that if you use the latestComments component on the page, and it is rendered before the comments component then a comment is not part of the latest comment list when the page is returned as a result of adding a comment.

Using the model execution feature would solve this problem.

Generated at Mon Feb 12 00:02:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.