Bugs item #830652, was opened at 2003-10-26 21:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=536613&aid=830652&group_id=73068
Category: main tag library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: fabrizio giustina (fgiust)
Assigned to: fabrizio giustina (fgiust)
Summary: parameters in requestURI are not included in URLs
Initial Comment:
[reported by Dave Nebinger in the displaytag-users
mailing list]
Hey guys, first of all you've got a great project going
on. Keep up the good work.
I'm using the 1.0b2 release...
Anyway there's a bug in the handling of hrefs in the
<display:table> tag; you can't use a requestURI with
parameters such as in the following:
<display:table name="srwt_list" sort="list"
defaultsort="1" export="true" length="20"
requestURI="dispsys.do?pagekey=0200"
useSortImages="true" >
The TableTag.initHref() method calls
Href.setParameterMap() with the parms from the
TableTag which effectively wipes out any parameters
defined in the request URI value.
I'm not sure how you would like to solve this, but I
implemented the following successful solution:
/**
* Sets the parameters in the Href. The value in the
given Map will be escaped before added
* @param parametersMap Map containing
parameters
*/
public void setParameterMap(Map parametersMap) {
Map lCurrentParmMap = mParameters;
Map.Entry entry;
String key,value;
// create a new HashMap
mParameters = new HashMap
(parametersMap.size());
// copy value, escaping html
Iterator mapIterator = parametersMap.entrySet
().iterator();
while (mapIterator.hasNext()) {
entry = (Map.Entry) mapIterator.next();
key = StringEscapeUtils.escapeHtml
((String)
entry.getKey());
value = StringEscapeUtils.escapeHtml
((String)
entry.getValue());
mParameters.put(key, value);
}
// parms are set up, add the incoming parms if
not overridden...
if (lCurrentParmMap != null) {
mapIterator = lCurrentParmMap.entrySet
().iterator();
while (mapIterator.hasNext()) {
entry = (Map.Entry) mapIterator.next
();
key = StringEscapeUtils.escapeHtml
((String)
entry.getKey());
value = StringEscapeUtils.escapeHtml
((String)
entry.getValue());
if (mParameters.containsKey(key) ==
false) {
// doesn't have this key, add it
mParameters.put(key,value);
}
}
}
}
Feel free to use this if you'd like.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=536613&aid=830652&group_id=73068
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel