----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------



> -----Original Message-----
> From: Alexander Jesse [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 18, 2000 6:24 PM
> To: java-apache-users
> Subject: RE: problem with getQueryString

> try:
> public void doGet(HttpServletRequest req,
>  HttpServletResponse resp) throws
>  ServletException, IOException  {
>             String tempString = req.getQueryString(); //first change
>         resp.setContentType("text/html");
>         PrintWriter out = resp.getWriter();
>         out.println (tempString); //second change
>         out.close();
>        }
>  }
> 
> maybe the problem is, that you have to get the request-stuff before
> messing around with the response-stuff...

That can't cause the problem.
I often use response.setContentType () before reading the
request-parameters.

The HttpServletRequest and HttpServletResponse are two OBJECTS. There is no
reason, why i should use them in an special order when they are implemented
correctly. 

> 
> 
> good luck
> Alexander Jesse
> 
> > -----Original Message-----
> > From: cdangremont [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 18, 2000 6:15 PM
> > To: java-apache-users
> > Subject: RE: problem with getQueryString
> >
> >
> > > -----Message d'origine-----
> > > De : [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]De la 
> part de Viehl
> > > Clemens
> > > Envoy� : mardi 18 janvier 2000 17:37
> > > � : 'Java Apache Users'
> > > Cc : '[EMAIL PROTECTED]'
> > > Objet : RE: problem with getQueryString
> > >
> > >
> > >
> > > Hello,
> > >
> > > shouldn't your query look more like this:
> > > OLD: http://myserver/myservlet?field1=linux+field2=apache
> > > NEW: http://myserver/myservlet?field1=linux&field2=apache
> > >                                            ^
> >
> > even when there is only one parameter, the getQueryString 
> returns NULL
> >
> > >
> > > But this would not explain why getQueryString returns null.
> > > How does your method call looks like exactly?
> > >
> > > It should look like this:
> > >
> > > public void doGet/Post (HttpServletRequest req,
> > > HttpServletResponse resp) {
> > >
> > >   String query = null;
> > >   query = req.getQueryString ();
> > > }
> > >
> > this is my servlet code, it isvery very simple :
> >
> >
> > public class OpteLet extends HttpServlet
> > {
> >       public void doGet(HttpServletRequest req,
> > HttpServletResponse resp) throws
> > ServletException, IOException
> >       {
> >               resp.setContentType("text/html");
> >               PrintWriter out = resp.getWriter();
> >               out.println (req.getQueryString());
> >               out.close();
> >       }
> > }
> > > > But the call of the getQueryString java method always returns
> > > > me a NULL
> > > This don't show if you use the method right. But when you can
> > > compile it, it
> > > should be ok.
> > >
> > > I hope i could help a bit, but i can't offer an easy
> > solution for your
> > > problem.
> > >
> > > Regards
> > >
> > > Clemens Viehl
> >
> >
> > I hope this will makes the problem explained in a clearest manner.
> >
> > Regards.
> >
> > Cedric DANGREMONT
> >
> >
> > > --------------------------------------------------------------
> > > Please read the FAQ! <http://java.apache.org/faq/>
> > > To subscribe:        [EMAIL PROTECTED]
> > > To unsubscribe:      [EMAIL PROTECTED]
> > > Archives and Other:  <http://java.apache.org/main/mail.html>
> > > Problems?:           [EMAIL PROTECTED]
> >
> >
> >
> > --
> > --------------------------------------------------------------
> > Please read the FAQ! <http://java.apache.org/faq/>
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Archives and Other:  <http://java.apache.org/main/mail.html>
> > Problems?:           [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> 
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]
> 


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to