Issue Details (XML | Word | Printable)

Key: DISPL-449
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Critical Critical
Reporter: Philip J Brown
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DisplayTag

Sort does not work with webwork... the format of displayTag parameters cause webwork to throw an exception

Created: 28/Feb/07 10:41 PM   Updated: 14/Aug/07 04:31 PM
Component/s: None
Affects Version/s: 1.0, 1.1
Fix Version/s: None

Time Tracking:
Not Specified

Application server: WebWork 2


 Description  « Hide
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

        

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Philip J Brown added a comment - 28/Feb/07 10:43 PM
The problem is manifest by webwork throwing a ognl.InappropriateExpressionException exception.

Philip J Brown added a comment - 01/Mar/07 02:43 AM
The issue can be gracefully handled from within webwork, so there is no need to change displayTag.

See http://forums.opensymphony.com/thread.jspa?threadID=63234 for thread on how to easily fix the problem from within xwork
(which is used by webwork and struts2).

This at least makes this issue low priority (not critical), and may even mean that the issue can be closed.

I don't have permission to change the priority, but I wanted to update this issue since I initially created it.

Anyone who has the correct permissions, feel free to close or change this issue however you see fit.

        -Phil