tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Campbell <chris.campb...@lincmedia.co.jp>
Subject RE: Dictate what happens when page loads based on the Querry Stri ng
Date Wed, 29 May 2002 03:52:27 GMT

You need to check for null parameter first:

String sPage = request.getParameter("Page");

if (sPage != null && !"".equals(sPage)) {

ChrisC

> -----Original Message-----
> From: Nicholas Orr [mailto:Nicholas.Orr@mim.com.au]
> Sent: Wednesday, May 29, 2002 12:41 PM
> To: Tomcat Users List
> Subject: Dictate what happens when page loads based on the 
> Querry String
> 
> 
> Ok,
> 
> I type in the following url http://localhost/Forms/form.jsp
> 
> Now what should happen is it should do what is in the case 1 
> of the switch.
> 
> But it doesn't. It gets caught up on the fact that there is no Page
> paramater.
> 
> I have come from the world of asp, and something like this is achieved
> simply by doing this.
> 
> If len(request("Page")) < 0 Then
>   sPage = "1"
> End If
> 
> It doesn't matter if "page" is there or not, if page is there 
> in the form of
> form.asp?Page= then the length = 0 if it is form.asp then length = 0
> 
> How do you do this in java?
> 
> The reason I have the else in there is I have to convert sPage into a
> integer cause switch doesn't accept strings unlike VB's 
> Select which does.
> 
> 
> 
> **********************************************************************
> The information contained in this e-mail is confidential and is
> intended only for the use of the addressee(s).
> If you receive this e-mail in error, any use, distribution or
> copying of this e-mail is not permitted. You are requested to
> forward unwanted e-mail and address any problems to the
> MIM Holdings Limited Support Centre.
> 
> For general enquires:	++61 7 3833 8000
> Support Centre e-mail:	supportcentre@mim.com.au
> Support Centre phone:  	Australia 1800500646
>         				International ++61 7 38338042
> **********************************************************************
> 
> 

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


Mime
View raw message