Make hidden fields (_sourcePage, __fb) optional for GET-forms
-------------------------------------------------------------
Key: STS-839
URL: http://www.stripesframework.org/jira/browse/STS-839
Project: Stripes
Issue Type: Improvement
Components: Tag Library
Affects Versions: Release 1.5.6
Reporter: Carl Krig
Priority: Minor
Use case; trivial page browsing form as part of a bigger screen
...
Page
<stripes:form action="/browser" method="get" style="display: inline;">
<stripes:param name="some" />
<stripes:param name="other" />
<stripes:text name="pageNumber" onkeypress="javascript:if
(window.event.keycode == 13 || event.which) this.parent.submit();">
</stripes:form>
of ${actionBean.pageCount}
...
Problems;
* GET puts the two hidden fields _sourcePage, __fb in the face of the user for
no practical purpose
* POST has the known refresh-side-effect (pressing F5 gives the user the popup
asking permission to re-post)
* The url is baked (has a @UrlBinding) so the stripes:param tags are really
valuable to avoid hard-coding the recipe in multiple places, so substituting
with a plain <form> tag is out of the question.
Wish;
It would be nice to have something like partial="true" that omits the hidden
fields but still outputs the form tag.
Suggestion 1: Add plain="true" with suggested functionality (Drawback: stacking
yet another attribute on there)
Suggestion 2: Make method="get" omit the hidden fields. (Drawback: might break
existing code out there)
Suggestion 3: Make method="get-funky" omit the hidden fields and output
method="get". (Drawback: non-standard)
Workaround is to go with the default method POST and add to the action code;
if ("POST".equals(getContext().getRequest().getMethod())) {
return new RedirectResolution(getClass()).addParameter("some",
some).addParameter("other", other).addParameter("pageNumber", pageNumber);
}
Drawback with this workaround is of course the extra roundtrip just to hide
nonsense query parameters.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development