DisplayTag
  1. DisplayTag
  2. DISPL-449

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

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical 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

              

        Activity

        Hide
        Philip J Brown added a comment -
        The problem is manifest by webwork throwing a ognl.InappropriateExpressionException exception.
        Show
        Philip J Brown added a comment - The problem is manifest by webwork throwing a ognl.InappropriateExpressionException exception.
        Hide
        Philip J Brown added a comment -
        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
        Show
        Philip J Brown added a comment - 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

          People

          • Reporter:
            Philip J Brown
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: