jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tlv JstlCoreTLV.java
Date Mon, 04 Feb 2002 03:17:19 GMT
shawn       02/02/03 19:17:19

  Modified:    standard/examples/web/import EncodeQueryString.jsp
               standard/src/org/apache/taglibs/standard/tag/common/core
                        ParamSupport.java URLEncodeSupport.java
               standard/src/org/apache/taglibs/standard/tlv
                        JstlCoreTLV.java
  Log:
  URLEncode changes.
  
  Revision  Changes    Path
  1.3       +11 -0     jakarta-taglibs/standard/examples/web/import/EncodeQueryString.jsp
  
  Index: EncodeQueryString.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/import/EncodeQueryString.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EncodeQueryString.jsp	20 Dec 2001 00:45:31 -0000	1.2
  +++ EncodeQueryString.jsp	4 Feb 2002 03:17:19 -0000	1.3
  @@ -13,3 +13,14 @@
   <c:urlEncode var="email" value="horwat@fakeaddress.com"/>
   
   <c:import url="$'LocalQueryString.jsp?name=' + name + '&email=' + email" />
  +
  +<hr />
  +<c:urlEncode value="http://foo">
  +  <c:param name="foo" value="bar"/>
  +  <c:param name="foo2" value="bar2"/>
  +</c:urlEncode>
  +
  +<hr />
  +<c:urlEncode value="http://foo?a=b">
  +  <c:param name="foo" value="bar"/>
  +</c:urlEncode>
  
  
  
  1.3       +1 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/core/ParamSupport.java
  
  Index: ParamSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/core/ParamSupport.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParamSupport.java	4 Feb 2002 02:39:51 -0000	1.2
  +++ ParamSupport.java	4 Feb 2002 03:17:19 -0000	1.3
  @@ -100,7 +100,7 @@
   	if (t == null)
   	    throw new JspTagException(
   		Resources.getMessage("PARAM_OUTSIDE_PARENT"));
  -	ParamParent parent = (ImportSupport) t;
  +	ParamParent parent = (ParamParent) t;
   	String value = this.value;
   	if (value == null) {
   	    if (bodyContent == null || bodyContent.getString() == null)
  
  
  
  1.4       +9 -5      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/core/URLEncodeSupport.java
  
  Index: URLEncodeSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/core/URLEncodeSupport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- URLEncodeSupport.java	4 Feb 2002 02:39:51 -0000	1.3
  +++ URLEncodeSupport.java	4 Feb 2002 03:17:19 -0000	1.4
  @@ -137,6 +137,9 @@
                   operand = bodyContent.getString().trim();
           }
   
  +	// encode the input
  +	String result = URLEncoder.encode(operand);
  +
   	// add parameters
   	if (params != null) {
   	    // produce a StringBuffer containing all the parameters
  @@ -149,16 +152,17 @@
   		    paramString.append("&");
   	    }
   
  +	    /*
  +             * Note: This doesn't really make sense, but I think it's a
  +             * spec issue.
  +             */
   	    // append these parameters with a '?' or '&', as appropriate
               boolean firstParameter = operand.indexOf('?') == -1;
               if (firstParameter)
  -		operand += "?" + paramString;
  +		result += "?" + paramString;
               else
  -		operand += "&" + paramString;
  +		result += "&" + paramString;
   	}
  -
  -	// encode the input
  -	String result = URLEncoder.encode(operand);
   
   	// store or print the output
   	if (var != null)
  
  
  
  1.9       +0 -5      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tlv/JstlCoreTLV.java
  
  Index: JstlCoreTLV.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tlv/JstlCoreTLV.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JstlCoreTLV.java	4 Feb 2002 02:39:52 -0000	1.8
  +++ JstlCoreTLV.java	4 Feb 2002 03:17:19 -0000	1.9
  @@ -272,11 +272,6 @@
   		    bodyIllegal = true;
   		else
   		    bodyNecessary = true;
  -	    } else if (isTag(qn, URL_ENCODE)) {
  -		if (hasAttribute(a, VALUE))
  -		    bodyIllegal = true;
  -		else
  -		    bodyNecessary = true;
   	    }
   
   	    // record the most recent tag (for error reporting)
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message