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
**********************************************************************
<%
int iBackPage;
int iNextPage;
int iPage;
String sTest;
String sPageName;
String sSubTitle;
String sFormName;
String sPage = request.getParameter("Page");
if (sPage.length() > 0)
{
iPage = 1;
iBackPage = 0;
iNextPage = 2;
sTest = "Page has a value";
}
else
{
iPage = 1;
iBackPage = 0;
iNextPage = 2;
sTest = "Page has no value";
}
switch (iPage)
{
case 1:
sPageName = "UserDetails.html";
sSubTitle = "User Details";
sFormName = "frmUserDetails";
break;
case 2:
sPageName = "LicensedProducts.html";
sSubTitle = "Licensed Products";
sFormName = "frmLicensedProducts";
break;
case 3:
sPageName = "DirectoryAccess.html";
sSubTitle = "Directory Access";
sFormName = "frmDirectoryAccess";
break;
default:
sPageName = "UserDetails.html";
sSubTitle = "User Details";
sFormName = "frmUserDetails";
break;
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>LAN User ID Request - <%= sSubTitle%></title>
<link href="style.css" rel="stylesheet" type="text/css">
<script language="Javascript">
function btnCancel_onClick()
{
var intResponse = alert("Cancel User ID Creation?");
}
function btnBack_onClick()
{
var theform = document.<%= sFormName%>;
theform.Page.value = "<%= iBackPage%>";
theform.submit();
}
function btnNext_onClick()
{
var theform = document.<%= sFormName%>;
theform.Page.value = "<%= iNextPage%>";
theform.submit();
}
</script>
</head>
<body>
<%= sTest%><br>
<%= sPage%>
<jsp:include page="<%= sPageName%>" flush="true" />
</body>
</html>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>