Balkrishna,
        Well your solution seems fine, except for it being quite
inefficient.
Why not store the value returned by the call to
request.getParameter("name");
in a variable and if the value is not null proceed or else don't.
Not very efficient to make two calls to the same method for the same
parameter.
Have a nice day.
With regards,
Sachin S. Khanna.
www.emailanorder.com

----- Original Message -----
From: Balkrishna <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 29, 2001 11:13 PM
Subject: Re: handling Query strings


> One possible solution for this is first check the parameter for null if
its
> null dont get that parameter
> e.g.
>
> if(request.getParameter("id")!=null)
> {
>   String str =   request.getParameter("id")   ;
> }
>
> ----- Original Message -----
> From: "Venkat" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, February 24, 2001 5:41 PM
> Subject: [JSP-INTEREST] handling Query strings
>
>
> > Hi All
> >
> > When we more than one querystring in JSP, how do we
> > read then in the next page, because if we use
> > request.getQueryString(), it returns the whole string
> > after '?'
> >
> > and if we use request.getParameter("parameterName"),
> > it works fine, but when requests come from different
> > pages and they do not contain this parameter, it
> > throws nullpointer exception.
> >
> > In detail:
> >
> > abc.jsp?id=123, in abc.jsp we can read id by using
> > request.getParameter("id"), but if a request comes
> > from another page, say, xyz.jsp to abc.jsp without any
> > parameter, abc.jsp throws expection
> >
> > Is there any better way of dealing with these
> > querystrings/parameters.  any examples/links are
> > highly appreciated
> >
> > Regards
> >
> > Venkat
> >
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> > ========================================================================
> > ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to