Example usage for javax.servlet.http HttpServletRequest getParameterValues

List of usage examples for javax.servlet.http HttpServletRequest getParameterValues

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getParameterValues.

Prototype

public String[] getParameterValues(String name);

Source Link

Document

Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

Usage

From source file:fr.paris.lutece.plugins.sponsoredlinks.web.SponsoredLinksJspBean.java

/**
 * Process the data capture form of a modified sponsoredlinks set
 *
 * @param request The Http Request//from  ww w.j  a  v  a  2s .  com
 * @return The Jsp URL of the process result
 */
public String doModifySet(HttpServletRequest request) {
    String strSetId = request.getParameter(PARAMETER_SET_ID);

    if ((request.getParameter(PARAMETER_CANCEL) != null)
            || (StringUtils.isNotBlank(strSetId) && !RBACService.isAuthorized(SponsoredLinkSet.RESOURCE_TYPE,
                    strSetId, SponsoredLinksSetResourceIdService.PERMISSION_MODIFY_SET, getUser()))) {
        return JSP_REDIRECT_TO_MANAGE_SET;
    }

    String strTitle = request.getParameter(PARAMETER_SET_TITLE);
    String strGroupId = request.getParameter(PARAMETER_GROUP_ID);
    String[] strArrayLinks = request.getParameterValues(PARAMETER_SET_LINK_LIST);

    // Mandatory fields
    if (StringUtils.isBlank(strSetId) || StringUtils.isBlank(strTitle) || StringUtils.isBlank(strGroupId)
            || (strArrayLinks == null) || (strArrayLinks.length == 0)) {
        return AdminMessageService.getMessageUrl(request, Messages.MANDATORY_FIELDS, AdminMessage.TYPE_STOP);
    }

    int nSetId = Integer.parseInt(strSetId);
    int nGroupId = Integer.parseInt(strGroupId);

    SponsoredLinkSet set = new SponsoredLinkSet();
    List<SponsoredLink> linkList = new ArrayList<SponsoredLink>();
    SponsoredLink currentLink;

    for (int i = strArrayLinks.length - 1; i >= 0; --i) {
        if (!strArrayLinks[i].trim().equals("\u00A0")) {
            currentLink = new SponsoredLink();
            currentLink.setOrder(i + 1);
            currentLink.setLink(strArrayLinks[i]);

            if (currentLink.isValidLink()) {
                linkList.add(currentLink);
            } else {
                AppLogService.error(new InvalidParameterException("In SponsoredLinkSet \"" + strTitle + "\" : "
                        + " SponsoredLink[" + currentLink.getOrder() + "] - " + currentLink.getLink()
                        + "> : is not a valid html link"));
            }
        }
    }

    set.setId(nSetId);
    set.setTitle(strTitle);
    set.setGroupId(nGroupId);
    set.setSponsoredLinkList(linkList);

    SponsoredLinkSetHome.update(set, getPlugin());

    // if the operation occurred well, redirects towards the list of sets
    return JSP_REDIRECT_TO_MANAGE_SET;
}

From source file:org.openmrs.module.formfilter.web.controller.AddFormFilterPropertyController.java

/**
 * Handles request to save or update a filter to db.
 * /*from  w  w w . ja v a2s  .c om*/
 * @param formFilterProperty
 * @param request
 * @return to viewformfilter page to see list of all assigned filter's to a form.
 * @should add new FormFilterProperty
 * @should update FormFilterProperty
 */
@RequestMapping(value = "/module/formfilter/addformproperty", method = RequestMethod.POST)
public String onSubmit(@ModelAttribute("formfilterproperty") FormFilterProperty formFilterProperty,
        BindingResult result, SessionStatus status, HttpServletRequest request) {

    String propertyType = request.getParameter("propertyType");
    int formFilterId = Integer.parseInt(request.getParameter("formFilterId"));
    FormFilterService formFilterService = (FormFilterService) Context.getService(FormFilterService.class);

    //Based on selected propertyType option in form , className and properties of formFilterPropertyType
    //object are set manually.
    if (propertyType.equalsIgnoreCase("AgeProperty")) {
        formFilterProperty.setClassName("org.openmrs.module.formfilter.impl.AgeFormFilter");
        formFilterProperty.setProperties("minimumAge=" + request.getParameter("minimumAge") + "&maximumAge="
                + request.getParameter("maximumAge"));
    } else if (propertyType.equalsIgnoreCase("GenderProperty")) {
        formFilterProperty.setClassName("org.openmrs.module.formfilter.impl.GenderFormFilter");
        formFilterProperty.setProperties("gender=" + request.getParameter("gender"));
    } else if (propertyType.equalsIgnoreCase("DateProperty")) {
        formFilterProperty.setClassName("org.openmrs.module.formfilter.impl.DateFormFilter");
        formFilterProperty.setProperties(
                "date=" + request.getParameter("date") + "&show=" + request.getParameter("show"));
    } else if (propertyType.equalsIgnoreCase("RoleProperty")) {
        formFilterProperty.setClassName("org.openmrs.module.formfilter.impl.RoleFormFilter");
        String roleArr[] = request.getParameterValues("roles");
        String properties = "";
        for (String string : roleArr) {
            properties += string + ",";
        }
        formFilterProperty.setProperties("roles=" + properties);
    } else if (propertyType.equalsIgnoreCase("PrivilegeProperty")) {
        formFilterProperty.setClassName("org.openmrs.module.formfilter.impl.PrivilegeFormFilter");
        String privilegeArr[] = request.getParameterValues("privileges");
        String properties = "";
        for (String string : privilegeArr) {
            properties += string + ",";
        }
        formFilterProperty.setProperties("privileges=" + properties);
    } else if (propertyType.equalsIgnoreCase("CohortProperty")) {
        formFilterProperty.setClassName("org.openmrs.module.formfilter.impl.CohortFormFilter");
        formFilterProperty.setProperties("cohort=" + request.getParameter("cohort"));
    }

    //if id of formFilterProperty object is 0 , add filter as new or else update it.
    if (formFilterProperty.getFormFilterPropertyId() == 0) {
        formFilterService.addFormFilterProperty(formFilterId, formFilterProperty);
    } else {
        formFilterService.saveFormFilterProperty(formFilterProperty);
    }

    return "redirect:viewformfilter.form?formFilterId=" + formFilterId;

}

From source file:pivotal.au.se.gemfirexdweb.controller.GatewaySenderController.java

@RequestMapping(value = "/gatewaysenders", method = RequestMethod.POST)
public String performGatewaySendersAction(Model model, HttpServletResponse response, HttpServletRequest request,
        HttpSession session) throws Exception {
    if (session.getAttribute("user_key") == null) {
        logger.debug("user_key is null new Login required");
        response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
        return null;
    } else {/*from w ww .  j  a v a 2  s  .  c o m*/
        Connection conn = AdminUtil.getConnection((String) session.getAttribute("user_key"));
        if (conn == null) {
            response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
            return null;
        } else {
            if (conn.isClosed()) {
                response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
                return null;
            }
        }

    }

    int startAtIndex = 0, endAtIndex = 0;
    Result result = new Result();
    List<GatewaySender> gatewaysenders = null;

    logger.debug("Received request to perform an action on the gateway senders");

    GatewaySenderDAO gsDAO = GemFireXDWebDAOFactory.getGatewaySenderDAO();

    if (request.getParameter("search") != null) {
        gatewaysenders = gsDAO.retrieveGatewaySenderList((String) session.getAttribute("schema"),
                (String) request.getParameter("search"), (String) session.getAttribute("user_key"));

        model.addAttribute("search", (String) request.getParameter("search"));
    } else {
        String[] tableList = request.getParameterValues("selected_gatewaysenders[]");
        String commandStr = request.getParameter("submit_mult");

        logger.debug("tableList = " + Arrays.toString(tableList));
        logger.debug("command = " + commandStr);

        // start actions now if tableList is not null

        if (tableList != null) {
            List al = new ArrayList<Result>();
            for (String senderId : tableList) {
                result = null;
                result = gsDAO.simplegatewaySenderCommand(senderId, commandStr,
                        (String) session.getAttribute("user_key"));
                al.add(result);
            }

            model.addAttribute("arrayresult", al);
        }

        gatewaysenders = gsDAO.retrieveGatewaySenderList((String) session.getAttribute("schema"), null,
                (String) session.getAttribute("user_key"));
    }

    model.addAttribute("records", gatewaysenders.size());
    model.addAttribute("estimatedrecords", gatewaysenders.size());

    UserPref userPref = (UserPref) session.getAttribute("prefs");

    if (gatewaysenders.size() <= userPref.getRecordsToDisplay()) {
        model.addAttribute("gatewaysenders", gatewaysenders);
    } else {
        if (request.getParameter("startAtIndex") != null) {
            startAtIndex = Integer.parseInt(request.getParameter("startAtIndex"));
        }

        if (request.getParameter("endAtIndex") != null) {
            endAtIndex = Integer.parseInt(request.getParameter("endAtIndex"));
            if (endAtIndex > gatewaysenders.size()) {
                endAtIndex = gatewaysenders.size();
            }
        } else {
            endAtIndex = userPref.getRecordsToDisplay();
        }

        List subList = gatewaysenders.subList(startAtIndex, endAtIndex);
        model.addAttribute("gatewaysenders", subList);
    }

    model.addAttribute("startAtIndex", startAtIndex);
    model.addAttribute("endAtIndex", endAtIndex);

    // This will resolve to /WEB-INF/jsp/gatewaysenders.jsp
    return "gatewaysenders";

}

From source file:pivotal.au.se.gemfirexdweb.controller.DiskStoreController.java

@RequestMapping(value = "/diskstores", method = RequestMethod.POST)
public String performDiskStoreAction(Model model, HttpServletResponse response, HttpServletRequest request,
        HttpSession session) throws Exception {
    if (session.getAttribute("user_key") == null) {
        logger.debug("user_key is null new Login required");
        response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
        return null;
    } else {// w ww .  j  a v  a2 s .c o m
        Connection conn = AdminUtil.getConnection((String) session.getAttribute("user_key"));
        if (conn == null) {
            response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
            return null;
        } else {
            if (conn.isClosed()) {
                response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
                return null;
            }
        }

    }

    int startAtIndex = 0, endAtIndex = 0;
    Result result = new Result();
    List<DiskStore> dsks = null;
    String ddlString = null;

    logger.debug("Received request to perform an action on the disk stores");

    DiskStoreDAO dsDAO = GemFireXDWebDAOFactory.getDiskStoreDAO();

    if (request.getParameter("search") != null) {
        dsks = dsDAO.retrieveDiskStoreList("", (String) request.getParameter("search"),
                (String) session.getAttribute("user_key"));

        model.addAttribute("search", (String) request.getParameter("search"));
    } else {
        String[] tableList = request.getParameterValues("selected_ds[]");
        String commandStr = request.getParameter("submit_mult");

        logger.debug("tableList = " + Arrays.toString(tableList));
        logger.debug("command = " + commandStr);

        // start actions now if tableList is not null

        if (tableList != null) {
            List al = new ArrayList<Result>();
            List<String> al2 = new ArrayList<String>();

            for (String table : tableList) {
                if (commandStr.equalsIgnoreCase("DDL") || commandStr.equalsIgnoreCase("DDL_FILE")) {
                    ddlString = dsDAO.generateDDL(table, (String) session.getAttribute("user_key"));
                    al2.add(ddlString);
                } else {
                    result = null;
                    result = dsDAO.simplediskStoreCommand(table, commandStr,
                            (String) session.getAttribute("user_key"));
                    al.add(result);
                }
            }

            if (commandStr.equalsIgnoreCase("DDL")) {
                request.setAttribute("arrayresultddl", al2);
            } else if (commandStr.equalsIgnoreCase("DDL_FILE")) {
                response.setContentType(SAVE_CONTENT_TYPE);
                response.setHeader("Content-Disposition",
                        "attachment; filename=" + String.format(FILENAME, "DiskStoreDDL"));

                ServletOutputStream out = response.getOutputStream();
                for (String ddl : al2) {
                    out.println(ddl);
                }

                out.close();
                return null;
            } else {
                model.addAttribute("arrayresult", al);
            }
        }

        dsks = dsDAO.retrieveDiskStoreList("", null, (String) session.getAttribute("user_key"));
    }

    model.addAttribute("records", dsks.size());
    model.addAttribute("estimatedrecords", dsks.size());

    UserPref userPref = (UserPref) session.getAttribute("prefs");

    if (dsks.size() <= userPref.getRecordsToDisplay()) {
        model.addAttribute("diskstores", dsks);
    } else {
        if (request.getParameter("startAtIndex") != null) {
            startAtIndex = Integer.parseInt(request.getParameter("startAtIndex"));
        }

        if (request.getParameter("endAtIndex") != null) {
            endAtIndex = Integer.parseInt(request.getParameter("endAtIndex"));
            if (endAtIndex > dsks.size()) {
                endAtIndex = dsks.size();
            }
        } else {
            endAtIndex = userPref.getRecordsToDisplay();

        }

        List subList = dsks.subList(startAtIndex, endAtIndex);
        model.addAttribute("diskstores", subList);
    }

    model.addAttribute("startAtIndex", startAtIndex);
    model.addAttribute("endAtIndex", endAtIndex);

    // This will resolve to /WEB-INF/jsp/diskstores.jsp
    return "diskstores";

}

From source file:pivotal.au.se.gemfirexdweb.controller.HdfsStoreController.java

@RequestMapping(value = "/hdfsstores", method = RequestMethod.POST)
public String performHdfsStoreAction(Model model, HttpServletResponse response, HttpServletRequest request,
        HttpSession session) throws Exception {
    if (session.getAttribute("user_key") == null) {
        logger.debug("user_key is null new Login required");
        response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
        return null;
    } else {//from  w ww. jav a  2  s .c  om
        Connection conn = AdminUtil.getConnection((String) session.getAttribute("user_key"));
        if (conn == null) {
            response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
            return null;
        } else {
            if (conn.isClosed()) {
                response.sendRedirect(request.getContextPath() + "/GemFireXD-Web/login");
                return null;
            }
        }

    }

    int startAtIndex = 0, endAtIndex = 0;
    Result result = new Result();
    List<HdfsStore> hdfsStores = null;
    String ddlString = null;

    logger.debug("Received request to perform an action on the hdfs stores");

    HdfsStoreDAO hdfsDAO = GemFireXDWebDAOFactory.getHdfsStoreDAO();

    if (request.getParameter("search") != null) {
        hdfsStores = hdfsDAO.retrieveHdfsStoreList("", (String) request.getParameter("search"),
                (String) session.getAttribute("user_key"));

        model.addAttribute("search", (String) request.getParameter("search"));
    } else {
        String[] tableList = request.getParameterValues("selected_hdfs[]");
        String commandStr = request.getParameter("submit_mult");

        logger.debug("tableList = " + Arrays.toString(tableList));
        logger.debug("command = " + commandStr);

        // start actions now if tableList is not null

        if (tableList != null) {
            List al = new ArrayList<Result>();
            List<String> al2 = new ArrayList<String>();

            for (String table : tableList) {
                if (commandStr.equalsIgnoreCase("DDL") || commandStr.equalsIgnoreCase("DDL_FILE")) {
                    ddlString = hdfsDAO.generateDDL(table, (String) session.getAttribute("user_key"));
                    al2.add(ddlString);
                } else {
                    result = null;
                    result = hdfsDAO.simplehdfsStoreCommand(table, commandStr,
                            (String) session.getAttribute("user_key"));
                    al.add(result);
                }
            }

            if (commandStr.equalsIgnoreCase("DDL")) {
                request.setAttribute("arrayresultddl", al2);
            } else if (commandStr.equalsIgnoreCase("DDL_FILE")) {
                response.setContentType(SAVE_CONTENT_TYPE);
                response.setHeader("Content-Disposition",
                        "attachment; filename=" + String.format(FILENAME, "HDFSStoreDDL"));

                ServletOutputStream out = response.getOutputStream();
                for (String ddl : al2) {
                    out.println(ddl);
                }

                out.close();
                return null;
            } else {
                model.addAttribute("arrayresult", al);
            }
        }

        hdfsStores = hdfsDAO.retrieveHdfsStoreList("", null, (String) session.getAttribute("user_key"));
    }

    model.addAttribute("records", hdfsStores.size());
    model.addAttribute("estimatedrecords", hdfsStores.size());

    UserPref userPref = (UserPref) session.getAttribute("prefs");

    if (hdfsStores.size() <= userPref.getRecordsToDisplay()) {
        model.addAttribute("hdfsstores", hdfsStores);
    } else {
        if (request.getParameter("startAtIndex") != null) {
            startAtIndex = Integer.parseInt(request.getParameter("startAtIndex"));
        }

        if (request.getParameter("endAtIndex") != null) {
            endAtIndex = Integer.parseInt(request.getParameter("endAtIndex"));
            if (endAtIndex > hdfsStores.size()) {
                endAtIndex = hdfsStores.size();
            }
        } else {
            endAtIndex = userPref.getRecordsToDisplay();

        }

        List subList = hdfsStores.subList(startAtIndex, endAtIndex);
        model.addAttribute("hdfsstores", subList);
    }

    model.addAttribute("startAtIndex", startAtIndex);
    model.addAttribute("endAtIndex", endAtIndex);

    // This will resolve to /WEB-INF/jsp/hdfsstores.jsp
    return "hdfsstores";

}

From source file:alpha.portal.webapp.controller.UserFormController.java

/**
 * On submit./*  ww w  .ja  v a 2s.co m*/
 * 
 * @param user
 *            the user
 * @param errors
 *            the errors
 * @param request
 *            the request
 * @param response
 *            the response
 * @param model
 *            the model
 * @return the string
 * @throws Exception
 *             the exception
 */
@RequestMapping(method = RequestMethod.POST)
public String onSubmit(final User user, final BindingResult errors, final HttpServletRequest request,
        final HttpServletResponse response, final Model model) throws Exception {
    if (request.getParameter("cancel") != null) {
        if (!StringUtils.equals(request.getParameter("from"), "list"))
            return this.getCancelView();
        else
            return this.getSuccessView();
    }

    if (this.validator != null) { // validator is null during testing
        this.validator.validate(user, errors);

        if (errors.hasErrors() && (request.getParameter("delete") == null)) {
            model.addAttribute("contributorRoles", this.contributorRoleManager.getAll());
            return "userform";
        }
    }

    this.log.debug("entering 'onSubmit' method...");

    final Locale locale = request.getLocale();

    if (request.getParameter("delete") != null) {
        this.getUserManager().removeUser(user.getId().toString());
        this.saveMessage(request, this.getText("user.deleted", user.getFullName(), locale));

        return this.getSuccessView();
    } else {

        // only attempt to change roles if user is admin for other users,
        // showForm() method will handle populating
        if (request.isUserInRole(Constants.ADMIN_ROLE)) {
            final String[] userRoles = request.getParameterValues("userRoles");

            if (userRoles != null) {
                user.getRoles().clear();
                for (final String roleName : userRoles) {
                    user.addRole(this.roleManager.getRole(roleName));
                }
            }
        }

        final Integer originalVersion = user.getVersion();

        try {
            this.getUserManager().saveUser(user);
        } catch (final AccessDeniedException ade) {
            // thrown by UserSecurityAdvice configured in aop:advisor
            // userManagerSecurity
            this.log.warn(ade.getMessage());
            response.sendError(HttpServletResponse.SC_FORBIDDEN);
            return null;
        } catch (final UserExistsException e) {
            errors.rejectValue("username", "errors.existing.user",
                    new Object[] { user.getUsername(), user.getEmail() }, "duplicate user");

            // redisplay the unencrypted passwords
            user.setPassword(user.getConfirmPassword());
            // reset the version # to what was passed in
            user.setVersion(originalVersion);

            model.addAttribute("contributorRoles", this.contributorRoleManager.getAll());
            return "userform";
        }

        if (!StringUtils.equals(request.getParameter("from"), "list")) {
            this.saveMessage(request, this.getText("user.saved", user.getFullName(), locale));

            // return to main Menu
            return this.getCancelView();
        } else {
            if (StringUtils.isBlank(request.getParameter("version"))) {
                this.saveMessage(request, this.getText("user.added", user.getFullName(), locale));

                // Send an account information e-mail
                this.message.setSubject(this.getText("signup.email.subject", locale));

                try {
                    this.sendUserMessage(user,
                            this.getText("newuser.email.message", user.getFullName(), locale),
                            RequestUtil.getAppURL(request));
                } catch (final MailException me) {
                    this.saveError(request, me.getCause().getLocalizedMessage());
                }

                return this.getSuccessView();
            } else {
                this.saveMessage(request, this.getText("user.updated.byAdmin", user.getFullName(), locale));
            }
        }
    }

    return "redirect:/mainMenu";
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.coordinator.ManageFinalDegreeWorkDispatchAction.java

public ActionForward changeSelectedProposalsStatus(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response, FinalDegreeWorkProposalStatus status)
        throws FenixActionException, FenixServiceException {

    String[] selectedProposals = request.getParameterValues("selectedProposals");
    return changeProposals(mapping, actionForm, request, response, status, selectedProposals);
}

From source file:org.openmrs.module.personalhr.web.controller.NewPatientFormController.java

@Override
protected ModelAndView processFormSubmission(final HttpServletRequest request,
        final HttpServletResponse response, final Object obj, final BindException errors) throws Exception {

    this.newIdentifiers = new HashSet<PatientIdentifier>();

    final ShortPatientModel shortPatient = (ShortPatientModel) obj;

    this.log.debug(
            "\nNOW GOING THROUGH PROCESSFORMSUBMISSION METHOD.......................................\n\n");

    if (Context.isAuthenticated()) {
        final PatientService ps = Context.getPatientService();
        final MessageSourceAccessor msa = getMessageSourceAccessor();

        final String action = request.getParameter("action");
        if ((action == null) || action.equals(msa.getMessage("general.save"))) {

            final String[] identifiers = request.getParameterValues("identifier");
            final String[] types = request.getParameterValues("identifierType");
            final String[] locs = request.getParameterValues("location");
            this.pref = request.getParameter("preferred");
            if (this.pref == null) {
                this.pref = "";
            }/*from w w  w .  jav a  2 s .  c om*/

            if (this.log.isDebugEnabled()) {
                this.log.debug("identifiers: " + identifiers);
                if (identifiers != null) {
                    for (final String s : identifiers) {
                        this.log.debug(s);
                    }
                }

                this.log.debug("types: " + types);
                if (types != null) {
                    for (final String s : types) {
                        this.log.debug(s);
                    }
                }

                this.log.debug("locations: " + locs);
                if (locs != null) {
                    for (final String s : locs) {
                        this.log.debug(s);
                    }
                }

                this.log.debug("preferred: " + this.pref);
            }

            // loop over the identifiers to create the patient.identifiers set
            if (identifiers != null) {
                for (int i = 0; i < identifiers.length; i++) {
                    // arguments for the spring error messages
                    final String id = identifiers[i].trim();
                    final String[] args = { id };

                    // add the new identifier only if they put in some identifier string
                    if (id.length() > 0) {

                        // set up the actual identifier java object
                        PatientIdentifierType pit = null;
                        if ((types[i] == null) || types[i].equals("")) {
                            final String msg = getMessageSourceAccessor()
                                    .getMessage("PatientIdentifier.identifierType.null", args);
                            errors.reject(msg);
                        } else {
                            pit = ps.getPatientIdentifierType(Integer.valueOf(types[i]));
                        }

                        Location loc = null;
                        if ((locs[i] == null) || locs[i].equals("")) {
                            final String msg = getMessageSourceAccessor()
                                    .getMessage("PatientIdentifier.location.null", args);
                            errors.reject(msg);
                        } else {
                            loc = Context.getLocationService().getLocation(Integer.valueOf(locs[i]));
                        }

                        final PatientIdentifier pi = new PatientIdentifier(id, pit, loc);
                        pi.setPreferred(this.pref.equals(id + types[i]));
                        this.newIdentifiers.add(pi);

                        if (this.log.isDebugEnabled()) {
                            this.log.debug("Creating patient identifier with identifier: " + id);
                            this.log.debug("and type: " + types[i]);
                            this.log.debug("and location: " + locs[i]);
                        }

                    }
                }
            }
        }

    }

    // skip calling super.processFormSubmission so that setting up the page is done
    // again in the onSubmit method

    return onSubmit(request, response, shortPatient, errors);
}

From source file:net.naijatek.myalumni.modules.members.presentation.action.MaintainPrivateMessageAction.java

public ActionForward deleteMail(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    if (isCancelled(request)) {
        return mapping.findForward(BaseConstants.FWD_CANCEL);
    }//from ww  w.java 2  s  . c o  m

    MemberVO token = getCurrentLoggedInUser(request);

    // check to see if the user logged on is a member
    if (!memberSecurityCheck(request, token)) {
        return mapping.findForward(BaseConstants.FWD_LOGIN);
    }

    logger.debug("Deleting mail...");

    String[] mailArray = new String[0];

    PrivateMessageForm pmForm = (PrivateMessageForm) form;
    String memberId = token.getMemberId();
    String privMsgsAction = pmForm.getPrivMsgsAction();

    String privAdminDelete = StringUtil.safeString(pmForm.getPrivAdminDelete());
    String privAdminMove = StringUtil.safeString(pmForm.getPrivAdminMove());

    if (privAdminDelete.equalsIgnoreCase("yes") || privAdminMove.equalsIgnoreCase("yes")) {
        // check to see if the user logged on is a member
        if (!adminSecurityCheck(request, token)) {
            return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
        }
        memberId = BaseConstants.ADMIN_USERNAME_ID;
    }

    mailArray = request.getParameterValues("messageId");

    if (mailArray == null) {
        ActionMessages errors = new ActionMessages();
        errors.add(BaseConstants.WARN_KEY, new ActionMessage("error.selectOne"));
        saveMessages(request, errors);
        return mapping.getInputForward();
    }

    /**
     * DELETE MAIL
     */
    if (privMsgsAction.equalsIgnoreCase("delete")) {
        pmService.deleteMail(mailArray, memberId, getLastModifiedBy(request));
        doMailDuties(token, request);
    }
    /**
     * MOVE MAIL
     */
    else if (privMsgsAction.equalsIgnoreCase("move")) {
        String toFolder = pmForm.getFolderName();
        pmService.moveMail(mailArray, memberId, toFolder, getLastModifiedBy(request));
        doMailDuties(token, request);
    }
    /**
     * EMPTY TRASH
     */
    else if (privMsgsAction.equalsIgnoreCase("empty")) {
        pmService.deleteMail(mailArray, memberId, getLastModifiedBy(request));
        doMailDuties(token, request);
    }

    else {
        ActionMessages errors = new ActionMessages();
        errors.add(BaseConstants.FATAL_KEY, new ActionMessage("errors.technical.difficulty"));
        saveMessages(request, errors);
        return mapping.getInputForward();
    }

    return mapping.findForward(BaseConstants.FWD_SUCCESS);
}