Hi John,
Following is the full code.
public class VerifycodeAction extends ActionTemplateListAndEdit {
private static final Logger fLogger = Util.getLogger(VerifycodeAction.class);
public static final SqlId CHECK_VERIFICATION_CODE = new SqlId("CHECK_VERIFICATION_CODE");
public VerifycodeAction(RequestParser aRequestParser){
super(FORWARD, REDIRECT, aRequestParser);
}
public static final RequestParameter SERIALNO = RequestParameter
.withLengthCheck("serialno");
public static final RequestParameter VERIFICATIONCODE = RequestParameter
.withLengthCheck("verificationcode");
@Override
protected void attemptAdd() throws DAOException {
// TODO Auto-generated method stub
fLogger.info("In SignupAction serialnoAndVerificationCode().");
serialno = getParam(SERIALNO);
addToSession("serialno", serialno);
verificationcode = getParam(VERIFICATIONCODE);
try{
fLogger.info("Serial No :"+serialno+" "+"Verification code :"+verificationcode);
SafeText verification = utility.getSerialnoAndVerificationCodeCorrect(serialno);
if(verification.equals(verificationcode)){
setResponsePage(REDIRECT);
}else{
setResponsePage(FORWARD);
} }catch(Exception e){
e.printStackTrace();
}
}
@Override
protected void attemptChange() throws DAOException {
// TODO Auto-generated method stub
}
@Override
protected void attemptDelete() throws DAOException {
// TODO Auto-generated method stub
}
@Override
protected void attemptFetchForChange() throws DAOException {
// TODO Auto-generated method stub
}
@Override
protected void doList() throws DAOException {
// TODO Auto-generated method stub
}
@Override
protected void validateUserInput() {
ModelFromRequest builder = new ModelFromRequest(getRequestParser());
try {
if (getErrors().isNotEmpty()) {
return;
}
Lmodel = builder.build(Verifycode.class, SERIALNO, VERIFICATIONCODE);
} catch (ModelCtorException ex) {
addError(ex);
}
}
boolean flag = true;
SafeText serialno;
SafeText verificationcode;
Utility utility = new Utility();
Verifycode Lmodel;
VerifycodeDAO fverifycodeDAO = new VerifycodeDAO();
/*private static ResponsePage FORWARD;*/
private static final ResponsePage REDIRECT = new ResponsePage(
"/pdt/main/patient/changepassword/ChangePasswordAction.list");
private static ResponsePage FORWARD = LoginTemplatedPage.get(
"Home", "view.jsp", VerifycodeAction.class);Thanks
Yadagiri
Please show more code. Please show how REDIRECT and FORWARD are defined.