Sorting and WebWork

View: New views
2 Messages — Rating Filter:   Alert me  

Sorting and WebWork

by Richard Wallace-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'm trying to use displaytag with WebWork.  I want my columns to be sortable.  The problem that I'm having is that the urls that are generated are causing problems for the WebWork setting values on actions from the parameters.  For instance, the parameter name "d-4002248-o" causes the exception:

2007-02-08 10:35:14,422 4178666 ERROR [btpool0-24] com.opensymphony.xwork.util.OgnlValueStack  (OgnlValueStack.java:158) - Error setting expr 'd-400224
with value '[Ljava.lang.String;@1c33b55'
ognl.InappropriateExpressionException : Inappropriate OGNL expression: (d - 4002248) - o
        at ognl.SimpleNode.setValueBody(SimpleNode.java:257)

This throws off the processing of the other parameters which causes values on my action to not get set. 

Is there an easy way to change the name of these parameters?  I tried sortName but that didn't work.  Any other suggestions?

Thanks,
Rich

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
displaytag-user@...
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Re: Sorting and WebWork

by pjbrownva :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Richard Wallace-2 wrote:
I'm trying to use displaytag with WebWork.  I want my columns to be
sortable.  The problem that I'm having is that the urls that are generated
are causing problems for the WebWork setting values on actions from the
parameters.
Richard,

I was having the same problem, and I found some easy changes to make to displayTag, and I even opened a Jira issue regarding it.
Then, AFTER I had done this, I found a post on the WebWork formum that addresses this problem.

Please see:  http://forums.opensymphony.com/thread.jspa?threadID=63234
for the easy fix.

If you don't like that approach, you could do it the "hard way" which is what I suggested below.

      -Phil

- - - -

I am having the same problem, and would appreciate any help or pointers if you or someone else
have discovered a fix or a work around to the problem.
...
Another idea that I have is to change the displaytag source code so that it uses "_" instead of "-" when creating the parameters.  
It seems that the dashes are hard coded in to the displaytag's ParamEncoder class
(see http://displaytag.sourceforge.net/11/displaytag/xref/org/displaytag/util/ParamEncoder.html )

Line 59 of that file shows:

   this.parameterIdentifier = "d-" + checkSum + "-"; //$NON-NLS-1$ //$NON-NLS-2$

It appears that simply changing this code and compiling your own custom jar should work.
For example change the code to read:
    this.parameterIdentifier = "d__" + checkSum + "__"; //$NON-NLS-1$ //$NON-NLS-2$

(Note that in this change, I used two underscores instead of the dashes).

I haven't tested this fix yet, but I believe that it would work.
    -Phil