do something like this
String queryString = request.getQueryString();
if (queryString == null)
{
// do something
iPage = 1;
iBackPage = 0;
iNextPage = 2;
sTest = "Page has no value";
} else
{
int i = queryString.indexOf("Page=");
if (i == -1)
{
// do something
iPage = 1;
iBackPage = 0;
iNextPage = 2;
sTest = "Page has no value";
} else
{
// do something
iPage = 1;
iBackPage = 0;
iNextPage = 2;
sTest = "Page has a value";
}
}
chaks.
-----Original Message-----
From: Nicholas Orr [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 29 May 2002 1: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: [EMAIL PROTECTED]
Support Centre phone: Australia 1800500646
International ++61 7 38338042
**********************************************************************