-
1. Re: How to strip request parameters for page reloads
fhh Apr 5, 2007 6:35 PM (in response to gzoller)
Any thoughts/better approaches?
Yep. Start using JSF.
Regards
Felix -
2. Re: How to strip request parameters for page reloads
dilator Apr 6, 2007 7:54 AM (in response to gzoller)^^^^
Vote for response of the month! -
3. Re: How to strip request parameters for page reloads
christian.bauer Apr 6, 2007 9:54 AM (in response to gzoller)The answer is short but correct :) Actions that modify data should be triggered with a JSF POSTback, not an HTTP GET parameter.
-
4. Re: How to strip request parameters for page reloads
gzoller Apr 6, 2007 11:23 AM (in response to gzoller)Ok, maybe I'm being a bit dense here...
How does using JSF help? Wouldn't using a h:commandLink have the same problem?
The scenario I've describe was lifted right out of the Seam tutorial, chapter 1. Is using the DataModel as currently envisioned not a good idea since the recommended use using s:link is a GET?
Seam carries parameters through from request to request. Would a mod to specifically filter out the dataModelSelect parameter and not carry it through fix this?
Greg -
5. Re: How to strip request parameters for page reloads
christian.bauer Apr 6, 2007 11:46 AM (in response to gzoller)If you use a POSTback (note the POST), the user would be told "Are you sure you want to reload this page and submit the data again" if he/she clicks Reload. If the user does want to "delete again", it's OK to show an error message.
If you try this with a GET (as the Seam example has), users would not see the warning and immediately see an error message. What error message depends on how the code is written, e.g. if the instance can be obtained again from the view (data model selection) and if entityManager.remove() is actually called if it can not be found, etc.