Mark:

I added the foll to the doGet in SecondServlet:

if (req.getQueryString() == null) out.println("Query String is null.<P>");
  else out.println("Query String is " + req.getQueryString() +"<P>");

ahead of:

  if (req.getParameter("name") != null)
      out.println("Name parameter is " + req.getParameter("name"));
  else out.println("Use queryString var if you want a param value with a Get!");

(kept the TestReqDispatcher the same) and then submitted the URL:
http://java2.cmpco.com/servlet/TestReqDispatcher?name=Cedric

And the results on my browser are:

In doGet of SecondServlet

Query String is name=Cedric

Name parameter is Cedric

So it looks like it's working as advertised on my system (JRun/Linux). As you suggest, 
it does look
like a weird bug in the servlet implementation you are working with. At least i cant 
think of any other
reason! (especially in view of your even stranger workaround!!)

Geeta
PS Please let me know if you find out anything else about this: thanks!

Mark Beaty wrote:

> Geeta,
>
> I tried your test code posted previously on this alias. I works fine, except for
> during a GET. For example, if I submit this URL from the browser
>
> http://www.myServer.com/servlet/TestReqDispatcher?name=Cedric
>
> a call, within SecondServlet.doGet(), to req.getParameter("name") returns null. So, 
>I tried calling
> req.getQueryString() and it also returns null. Can you try this and tell me if it
> works for you? I'm running under iPlanet Web Server 4.1sp3, which supports servlet
> API 2.2, so I don't think that should be the problem.
>
> Now, one very strange twist to this whole thing...IF, in the doGet() of 
>TestReqDispatcher,
> I add a call to req.getParameterNames(), THEN, it works. I am able to then call
> req.getParameter("name") in SecondServlet and I get the value for "name". So, just
> adding the following line to the doGet() of TestReqDispacther makes it work:
>
> Enumeration enum = req.getParameterNames();
>
> I know this is strange. It sounds like a very funky bug somewhere in the servlet api.
> If you could also give this a try and let me know the results, that would be great!
>
> Thanks.
> Mark
> --
>
> On Wed, 2 Aug 2000 12:52:55 -0400, Geeta Ramani <[EMAIL PROTECTED]> wrote:
>
> >Sanika:
> >
> >The parameters are *automatically* passed when you make a call to the request
> >dispatcher: a request dispatcher call within the doGet calls the called
> >servlets' doGet method and the original parameters can be retrieved as usual
> >with getParameter calls. A similar situation hold for the doPost.
> >
> >Geeta
> >PS You may want to search these archives for code samples..
> >
> >Sanika Kapoor wrote:
> >
> >> Hi All,
> >>
> >> Can any one tell me how do we pass params thru request dispatcher?
> >>
> >> Sanika.
> >> ________________________________________________________________________
> >> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> >>
> >> ___________________________________________________________________________
> >> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >> of the message "signoff SERVLET-INTEREST".
> >>
> >> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >> Resources: http://java.sun.com/products/servlet/external-resources.html
> >> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> >___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to