if (request.getParameter("accept") != null || request.getParameter("acceptPrint") != null) {
DynaActionForm dynaForm = (DynaActionForm) actionForm; if (!StringUtils.isEmpty((String)dynaForm.get("accepted")) || request.getParameter("acceptPrint") != null) {
    public ActionForward editFirstTimeParkingParty(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {        Integer parkingRequestID = new Integer(request.getParameter("code"));        final ParkingRequest parkingRequest = rootDomainObject.readParkingRequestByOID(parkingRequestID);        String note = request.getParameter("note");        Object args[] = { parkingRequest, null, null, null, note };        String parkingRequestState = request.getParameter("parkingRequestState");        if (parkingRequestState == null) {            parkingRequestState = "";        }        String parkingPartyClassification = request.getParameter("parkingPartyClassification");        if (parkingPartyClassification == null) {            parkingPartyClassification = "";        }        String personName = request.getParameter("personName");        if (personName == null) {            personName = "";        }        String carPlateNumber = request.getParameter("carPlateNumber");        if (carPlateNumber == null) {            carPlateNumber = "";        }        request.setAttribute("parkingRequestState", parkingRequestState);        request.setAttribute("parkingPartyClassification", parkingPartyClassification);        request.setAttribute("personName", personName);        request.setAttribute("carPlateNumber", carPlateNumber);        if (request.getParameter("accept") != null || request.getParameter("acceptPrint") != null) {            Integer cardNumber = null;            Integer group = null;            try {                cardNumber = new Integer(request.getParameter("cardNumber"));                if (cardNumber <= 0) {                    saveErrorMessage(request, "cardNumber", "error.number.below.minimum");                    request.setAttribute("idInternal", parkingRequestID);                    return showRequest(mapping, actionForm, request, response);                }            } catch (NullPointerException e) {                saveErrorMessage(request, "cardNumber", "error.requiredCardNumber");                request.setAttribute("idInternal", parkingRequestID);                return showRequest(mapping, actionForm, request, response);            } catch (NumberFormatException e) {                saveErrorMessage(request, "cardNumber", "error.invalidCardNumber");                request.setAttribute("idInternal", parkingRequestID);                return showRequest(mapping, actionForm, request, response);            }            try {                group = new Integer(request.getParameter("group"));            } catch (NullPointerException e) {                saveErrorMessage(request, "group", "error.requiredGroup");                request.setAttribute("idInternal", parkingRequestID);                return showRequest(mapping, actionForm, request, response);            } catch (NumberFormatException e) {                saveErrorMessage(request, "group", "error.invalidGroup");                request.setAttribute("idInternal", parkingRequestID);                return showRequest(mapping, actionForm, request, response);            }            if (!isValidCardNumber(cardNumber)) {                saveErrorMessage(request, "cardNumber", "error.alreadyExistsCardNumber");                request.setAttribute("idInternal", parkingRequestID);                return showRequest(mapping, actionForm, request, response);            }            if (!isValidGroup(group)) {                saveErrorMessage(request, "group", "error.invalidGroup");                request.setAttribute("idInternal", parkingRequestID);                return showRequest(mapping, actionForm, request, response);            }            args[1] = ParkingRequestState.ACCEPTED;            args[2] = cardNumber;            args[3] = group;        } else if (request.getParameter("reject") != null) {            args[1] = ParkingRequestState.REJECTED;        } else {            args[1] = ParkingRequestState.PENDING;        }        ServiceUtils.executeService(SessionUtils.getUserView(request), "UpdateParkingParty", args);        if (request.getParameter("acceptPrint") != null) {            request.setAttribute("parkingPartyID", parkingRequest.getParkingParty().getIdInternal());            printParkingCard(mapping, actionForm, request, response);        }        return showParkingRequests(mapping, actionForm, request, response);    }