tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From horn_...@jpmorgan.com
Subject Re: Bug in HttpServletRequest.getQueryString()? from POST
Date Tue, 30 Jan 2001 10:12:42 GMT

The query string is ONLY the parameters passed on the URL after the ?,
these can appear on both a GET and  a POST (though for POST it would have
to be in the action URL itself, not a form parameter).

If you want the list of parameters from form fields on a POST, you can get
them via request.getInputStream(). Normally they are encoded in the same
way as the query string (unless you change the enctype on the form).

This isn't a bug.





allsetbv@webmind.nl on 30/01/2001 04:18:59

Please respond to tomcat-user@jakarta.apache.org; Please respond to
      smcphers@mapquest.com

To:   tomcat-user@jakarta.apache.org
cc:    (bcc: Ken X Horn)
Subject:  Bug in HttpServletRequest.getQueryString()? from POST



Hi when processing a request in a tag extension class I get a "null"
returned when I call HttpServletRequest.getQueryString() after a POST
when I change the form to use GET, I
get the QueryString as expected. my code fragment  looks like:

   public int doStartTag( )
       throws JspTagException
   {
       try
       {
           previous = start - count;
           if ( previous < 0 )
           {
              previous = 0;
           }

           out.print( "<a href="+nextPage+"?startAmbiguity="+previous );

            //
            // WHY does getQueryString() return null from POST?
            //
           out.print( "&"+((HttpServletRequest)pageContext.getRequest(
)).getQueryString( ) );
           out.print( ">"+title+"</a>" );
           return SKIP_BODY;
       }
       catch ( IOException ex )
       {
           throw new JspTagException( ex.toString( ) );
       }
   }

The query string contains information which I don't particularily
displayed in a GET URL, so how do I work around this, apart from getting
all the parameters and building the query string myself?


begin:vcard
n:McPherson;Sandy
tel;cell:+31 6 224 70517
tel;fax:+31 527 68 74 80
tel;work:+31 527 68 70 10
x-mozilla-html:TRUE
org:Allset Consultancy BV.
version:2.1
email;internet:allsetbv@webmind.nl
title:Senior Consultant
adr;quoted-printable:;;Robbenplaat 18=0D=0A;Urk;;8321PA;Netherlands
x-mozilla-cpt:;32288
fn:Sandy McPherson
end:vcard



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org







Mime
View raw message