Feature Requests item #855128, was opened at 2003-12-06 01:05
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=536616&aid=855128&group_id=73068
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Caddel (jcaddel)
Assigned to: Nobody/Anonymous (nobody)
Summary: Allows parameters in the requestURI attribute
Initial Comment:
This is a patch to the initHref method of TableTag.java.
It adds a few lines of logic to preserve any parameters
that are present in the requestURI attribute of the
<display:table tag.
The behavior prior to this was to silently ignore any
parameters that were set in the requestURI attribute.
Here is the complete method implementation:
/**
* Method initHref
* @throws JspException generic exception
*/
protected void initHref() throws JspException
{
RequestHelper lRequestHelper = new
RequestHelper((HttpServletRequest)
pageContext.getRequest());
// get the href for this request
Href lNormalHref = lRequestHelper.getHref();
if (mRequestUri != null)
{
// if user has added a requestURI create a
new href
mBaseHref = new Href(mRequestUri);
//Preserve any parameters they included
with their requestURI
HashMap prevMap = mBaseHref.getParameterMap();
//Get parameters from the current request
HashMap lParameterMap =
lNormalHref.getParameterMap();
//Override any parameters in the current
request with parameters they explicitly provided
Iterator itr = prevMap.entrySet().iterator();
while(itr.hasNext()){
Map.Entry pair = (Map.Entry)itr.next();
lParameterMap.put(pair.getKey(),pair.getValue());
}
//Store the updated set of parameters
mBaseHref.setParameterMap(lParameterMap);
}
else
{
// simply copy href
mBaseHref = lNormalHref;
}
}
Here is the CVS diff -u formatted patch.
Index: TableTag.java
===================================================================
RCS file:
/cvsroot/displaytag/displaytag2/src/java/org/displaytag/tags/TableTag.java,v
retrieving revision 1.2
diff -u -r1.2 TableTag.java
--- TableTag.java 4 Sep 2003 20:09:32 -0000 1.2
+++ TableTag.java 5 Dec 2003 23:45:59 -0000
@@ -6,6 +6,7 @@
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
@@ -661,10 +662,23 @@
{
// if user has added a requestURI create a
new href
mBaseHref = new Href(mRequestUri);
+
+ //Preserve any parameters they included
with their requestURI
+ HashMap prevMap = mBaseHref.getParameterMap();
- // ... ancd copy parameters from the
curret request
+ //Get parameters from the current request
HashMap lParameterMap =
lNormalHref.getParameterMap();
+
+ //Override any parameters in the current
request with parameters they explicitly provided
+ Iterator itr = prevMap.entrySet().iterator();
+ while(itr.hasNext()){
+ Map.Entry pair = (Map.Entry)itr.next();
+
lParameterMap.put(pair.getKey(),pair.getValue());
+ }
+
+ //Store the updated set of parameters
mBaseHref.setParameterMap(lParameterMap);
+
}
else
{
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=536616&aid=855128&group_id=73068
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel