webwork/src/main/webwork/view/taglib URLTag.java,1.20,1.21
[email protected] Sat, 01 Nov 2003 12:15:03 -0800
| Newsgroups | gmane.comp.java.open-symphony.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/opensymphony/webwork/src/main/webwork/view/taglib In directory sc8-pr-cvs1:/tmp/cvs-serv16991/src/main/webwork/view/taglib Modified Files: URLTag.java Log Message: Fix for WW-338 Index: URLTag.java =================================================================== RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/view/taglib/URLTag.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- URLTag.java 30 Apr 2003 07:27:44 -0000 1.20 +++ URLTag.java 1 Nov 2003 20:15:00 -0000 1.21 @@ -10,7 +10,6 @@ import javax.servlet.http.*; import javax.servlet.jsp.JspException; -import javax.servlet.jsp.JspTagException; import javax.servlet.jsp.PageContext; import java.io.IOException; import java.net.URLEncoder; @@ -18,12 +17,12 @@ import java.util.Iterator; import java.util.Map; -import webwork.util.TextUtil; import webwork.util.BeanUtil; /** - * This tag is used to create a URL. You can use the "param" tag inside the body to provide - * additional request parameters. + * This tag is used to create a URL. + * You can use the "param" tag inside the body to provide + * additional request parameters. * * @see ParamTag * @author Rickard Öberg ([email protected]) @@ -38,6 +37,7 @@ protected String value; protected String includeParamsAttr; protected Map params; + protected StringBuffer link = new StringBuffer(); // Public -------------------------------------------------------- /** @@ -87,7 +87,10 @@ } else { value = page; } - params = null; + this.params.clear(); + this.page=null; + + link.delete(0, link.length()); //no explicit url set so attach params from current url, do //this at start so body params can override any of these they wish. @@ -101,7 +104,7 @@ { includeParams = findString(includeParamsAttr); } - + if (includeParams == null || includeParams.equals(GET)) { // Parse the query string to make sure that the parameters come from the query, and not some posted data @@ -118,12 +121,12 @@ } else if (includeParams.equals(ALL)) { - params.putAll(((HttpServletRequest) pageContext.getRequest()).getParameterMap()); + params.putAll(pageContext.getRequest().getParameterMap()); } else if (!includeParams.equals(NONE)) { - LogFactory.getLog(this.getClass()).warn("Unknown value for includeParams parameter to URL tag: " + includeParams); - } + LogFactory.getLog(this.getClass()).warn("Unknown value for includeParams parameter to URL tag: " + includeParams); + } } catch (Exception e) { LogFactory.getLog(this.getClass()).warn("Unable to put request parameters ("+((HttpServletRequest) pageContext.getRequest()).getQueryString()+") into parameter map.", e); } @@ -134,7 +137,6 @@ public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); - StringBuffer link = new StringBuffer(); if (value != null) { // Check if context path needs to be added @@ -208,7 +210,7 @@ String id = getId(); if(id != null) { pageContext.setAttribute(id, result); - pageContext.setAttribute(id, result, PageContext.REQUEST_SCOPE); + pageContext.setAttribute(id, result, PageContext.REQUEST_SCOPE); } else { try { pageContext.getOut().write(result); @@ -220,11 +222,3 @@ return EVAL_PAGE; } } - - - - - - - - ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/