Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Won't Fix
-
Affects Version/s: 1.0, 1.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Application server:WebWork 2
Description
The sort parameters created by displayTable cause problems for webWork2 users (and probably Struts Action 2 users as well) because I believe that the "-" are
treated as minus signs by webwork, causing webwork to attempt to evaluate the parameter name as an expression.
This problem could be easily fixed by changing to the use of a different character (such as "_", the underscore) and/or allowing the parameter prefix and parameter
suffix to be specified in a properties file.
It seems to me that the dashes are hard coded in to the displaytag's ParamEncoder class.
I believe that the fix could be easily accomplished by changing
Line 59 of ParamEncoder from:
this.parameterIdentifier = "d-" + checkSum + "-"; //$NON-NLS-1$ //$NON-NLS-2$
to something like this:
this.parameterIdentifier = "d__" + checkSum + "__"; //$NON-NLS-1$ //$NON-NLS-2$
(see http://displaytag.sourceforge.net/11/displaytag/xref/org/displaytag/util/ParamEncoder.html )
An even cleaner fix would be to read in values from the displayTag properties.
Maybe something along the lines of
ParamEncoder.prefix="d-"
and
ParamEncoder.suffix="-"
this would allow people to change the encoding by simply updating correct .properties file.
Here are links to two forum posts that might resolved by a fix that addresses this issue:
http://www.nabble.com/Sorting-and-WebWork-tf3194748.html
http://www.nabble.com/Changing-the-Parameter-Names-for-Page-Number---Sorting-tf1348466.html#a9243670
-Phil
treated as minus signs by webwork, causing webwork to attempt to evaluate the parameter name as an expression.
This problem could be easily fixed by changing to the use of a different character (such as "_", the underscore) and/or allowing the parameter prefix and parameter
suffix to be specified in a properties file.
It seems to me that the dashes are hard coded in to the displaytag's ParamEncoder class.
I believe that the fix could be easily accomplished by changing
Line 59 of ParamEncoder from:
this.parameterIdentifier = "d-" + checkSum + "-"; //$NON-NLS-1$ //$NON-NLS-2$
to something like this:
this.parameterIdentifier = "d__" + checkSum + "__"; //$NON-NLS-1$ //$NON-NLS-2$
(see http://displaytag.sourceforge.net/11/displaytag/xref/org/displaytag/util/ParamEncoder.html )
An even cleaner fix would be to read in values from the displayTag properties.
Maybe something along the lines of
ParamEncoder.prefix="d-"
and
ParamEncoder.suffix="-"
this would allow people to change the encoding by simply updating correct .properties file.
Here are links to two forum posts that might resolved by a fix that addresses this issue:
http://www.nabble.com/Sorting-and-WebWork-tf3194748.html
http://www.nabble.com/Changing-the-Parameter-Names-for-Page-Number---Sorting-tf1348466.html#a9243670
-Phil