I have a simple html page with the purpose of performing changes to an entity which is written to the database. The page has two forms:
- GET: select the entity to change
- POST: process the changes to the entity and write it to the database
When the POST action is performed I want to display the same page again, in addition I want to keep the entity parameter as set by the GET action. Currently I am doing the following at the end of the doPost method:
response.sendRedirect(path + "?entity=" + entityValue);
Which works perfectly fine, but after reading the differences between forward and sendRedirect I thought I have to use forward, but that won't work since the doGet method will not be executed as with sendRedirect. So is my approach correct or should this solved in another way?