jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-taglibs/request/src/org/apache/taglibs/request QueryStringTag.java
Date Mon, 11 Nov 2002 03:44:52 GMT
glenn       2002/11/10 19:44:52

  Modified:    request/src/org/apache/taglibs/request QueryStringTag.java
  Log:
  Fix a NPE when no query string exists
  
  Revision  Changes    Path
  1.3       +14 -13    jakarta-taglibs/request/src/org/apache/taglibs/request/QueryStringTag.java
  
  Index: QueryStringTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/QueryStringTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QueryStringTag.java	3 Nov 2000 12:52:20 -0000	1.2
  +++ QueryStringTag.java	11 Nov 2002 03:44:52 -0000	1.3
  @@ -100,16 +100,17 @@
       {
           String query =
               ((HttpServletRequest)pageContext.getRequest()).getQueryString();
  -                         
  -        StringTokenizer st = new StringTokenizer(query,"&");
  -        String prefix = name + "=";
  -	String tmp = null;
  -	String value = null;
  -        while( st.hasMoreTokens() ) {
  -	    tmp = st.nextToken();
  -            if( tmp.startsWith(prefix) ) {
  -                value = tmp.substring(prefix.length());
  -                break;
  +        String value = null;
  +        if( query != null ) {
  +            StringTokenizer st = new StringTokenizer(query,"&");
  +            String prefix = name + "=";
  +            String tmp = null;
  +            while( st.hasMoreTokens() ) {
  +                tmp = st.nextToken();
  +                if( tmp.startsWith(prefix) ) {
  +                    value = tmp.substring(prefix.length());
  +                    break;
  +                }
               }
           }
   
  
  
  

--
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