Search in sources :

Example 56 with ActionErrors

use of org.apache.struts.action.ActionErrors in project head by mifos.

the class MultipleGeneralLedgerActionForm method validate.

@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    logger.debug("GeneralLedgerActionForm.validate");
    // request.setAttribute(Constants.CURRENTFLOWKEY,
    // request.getParameter(Constants.CURRENTFLOWKEY));
    ActionErrors errors = new ActionErrors();
    if (request.getParameter(SimpleAccountingConstants.METHOD).equalsIgnoreCase(SimpleAccountingConstants.PREVIEW)) {
        return mandatoryCheck(getUserContext(request));
    }
    return errors;
}
Also used : ActionErrors(org.apache.struts.action.ActionErrors)

Example 57 with ActionErrors

use of org.apache.struts.action.ActionErrors in project head by mifos.

the class OpenBalanceActionForm method validate.

@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    logger.debug("OpenBalanceActionForm.validate");
    //	        request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
    ActionErrors errors = new ActionErrors();
    if (request.getParameter(SimpleAccountingConstants.METHOD).equalsIgnoreCase(SimpleAccountingConstants.PREVIEW)) {
        return mandatoryCheck(getUserContext(request));
    }
    return errors;
}
Also used : ActionErrors(org.apache.struts.action.ActionErrors)

Example 58 with ActionErrors

use of org.apache.struts.action.ActionErrors in project head by mifos.

the class PersonnelNoteActionForm method validate.

@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    String methodCalled = request.getParameter(Methods.method.toString());
    ActionErrors errors = null;
    if (null != methodCalled) {
        if (Methods.preview.toString().equals(methodCalled)) {
            errors = handlePreviewValidations(request, errors);
        }
    }
    if (null != errors && !errors.isEmpty()) {
        request.setAttribute(Globals.ERROR_KEY, errors);
        request.setAttribute("methodCalled", methodCalled);
    }
    return errors;
}
Also used : ActionErrors(org.apache.struts.action.ActionErrors)

Example 59 with ActionErrors

use of org.apache.struts.action.ActionErrors in project head by mifos.

the class AddGroupMembershipForm method validate.

@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    String method = request.getParameter(Methods.method.toString());
    if (method.equals(Methods.updateParent.toString())) {
    }
    if (!method.equals(Methods.validate.toString())) {
        request.setAttribute(GroupConstants.METHODCALLED, method);
    }
    return errors;
}
Also used : ActionErrors(org.apache.struts.action.ActionErrors)

Example 60 with ActionErrors

use of org.apache.struts.action.ActionErrors in project head by mifos.

the class GroupTransferActionForm method validate.

@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    String method = request.getParameter(Methods.method.toString());
    if (method.equals(Methods.removeGroupMemberShip.toString())) {
        errors.add(super.validate(mapping, request));
        if (StringUtils.isBlank(getAssignedLoanOfficerId())) {
            if (isActive == Constants.YES) {
                errors.add(GroupConstants.ASSIGNED_LOAN_OFFICER_REQUIRED, new ActionMessage(GroupConstants.ASSIGNED_LOAN_OFFICER_REQUIRED));
            }
        }
    }
    if (!method.equals(Methods.validate.toString())) {
        request.setAttribute(GroupConstants.METHODCALLED, method);
    }
    return errors;
}
Also used : ActionMessage(org.apache.struts.action.ActionMessage) ActionErrors(org.apache.struts.action.ActionErrors)

Aggregations

ActionErrors (org.apache.struts.action.ActionErrors)144 ActionMessage (org.apache.struts.action.ActionMessage)68 InvalidDateException (org.mifos.application.admin.servicefacade.InvalidDateException)20 Locale (java.util.Locale)19 ResourceBundle (java.util.ResourceBundle)13 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)12 Test (org.junit.Test)9 DoubleConversionResult (org.mifos.framework.util.helpers.DoubleConversionResult)7 Date (java.sql.Date)5 ApplicationException (org.mifos.framework.exceptions.ApplicationException)5 PageExpiredException (org.mifos.framework.exceptions.PageExpiredException)4 ReportsPersistence (org.mifos.reports.persistence.ReportsPersistence)4 DateTime (org.joda.time.DateTime)3 PaymentDataHtmlBean (org.mifos.accounts.loan.struts.uihelpers.PaymentDataHtmlBean)3 ReportsCategoryBO (org.mifos.reports.business.ReportsCategoryBO)3 Problem (cn.edu.zju.acm.onlinejudge.bean.Problem)2 ArrayList (java.util.ArrayList)2 ServletContext (javax.servlet.ServletContext)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpSession (javax.servlet.http.HttpSession)2