tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
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. on 30/01/2001 04:18:59

Please respond to; Please respond to

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

tel;cell:+31 6 224 70517
tel;fax:+31 527 68 74 80
tel;work:+31 527 68 70 10
org:Allset Consultancy BV.
title:Senior Consultant
adr;quoted-printable:;;Robbenplaat 18=0D=0A;Urk;;8321PA;Netherlands
fn:Sandy McPherson

To unsubscribe, e-mail:
For additional commands, email:

View raw message