home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Sample.bin
/
PHFormInput.java
< prev
next >
Wrap
Text File
|
1998-09-13
|
2KB
|
67 lines
package symantec.sourcebook.creditcheck;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class PHFormInput extends PageHandler
{
int pagenumber = CreditCheck.CARDENTRY_PAGE_NUM;
public PHFormInput()
{
}
public String pageName()
{
return null;
}
public Object validate(ServletConfig config,HttpServletRequest request,HttpServletResponse response)
{
PageData pageData = new PageData(config,request,response);
String errorText = "";
// get information from the form
pageData.ccName = getParameter(request,"ccName","");
pageData.ccTotal = getParameter(request,"ccTotal","");
pageData.successCGI = getParameter(request,"successCGI","");
pageData.orderId = getParameter(request,"orderId","");
// do some sanity checks
if(pageData.ccName.length() < 1) errorText += "No ccName field<br>";
if(pageData.ccTotal.length() < 1) errorText +="No ccTotal field<br>";
if(pageData.successCGI.length() < 1) errorText +="No successCGI field<br>";
if(pageData.orderId.length() < 1) errorText +="No orderId field<br>";
// if it looks bad, bail
if(errorText.length() > 0)
{
pagenumber = CreditCheck.ERROR_PAGE_NUM;
pageData.messageText = errorText;
return pageData;
}
return pageData;
}
public int nextPage()
{
return pagenumber;
}
}