String edit = resources.getMessage("button.edit").toLowerCase(); String save = resources.getMessage("button.save").toLowerCase(); String search = resources.getMessage("button.search").toLowerCase(); String view = resources.getMessage("button.view").toLowerCase();
String edit = resources.getMessage(Locale.ENGLISH, "button.edit").toLowerCase(); String save = resources.getMessage(Locale.ENGLISH, "button.save").toLowerCase(); String search = resources.getMessage(Locale.ENGLISH, "button.search").toLowerCase(); String view = resources.getMessage(Locale.ENGLISH, "button.view").toLowerCase();
    public ActionForward execute(ActionMapping mapping, ActionForm form,                                 HttpServletRequest request,                                 HttpServletResponse response)            throws Exception {        if (isCancelled(request)) {            ActionForward af = cancelled(mapping, form, request, response);            if (af != null) {                return af;            }        }        MessageResources resources = getResources(request);        // this call grabs any messages in the session and stuffs them in the        // request        ActionMessages messages = getMessages(request);        // Identify the localized message for the cancel button        String edit = resources.getMessage("button.edit").toLowerCase();        String save = resources.getMessage("button.save").toLowerCase();        String search = resources.getMessage("button.search").toLowerCase();        String view = resources.getMessage("button.view").toLowerCase();        String[] rules = {edit, save, search, view};        // Identify the request parameter containing the method name        String parameter = mapping.getParameter();        String keyName = request.getParameter(parameter);        if ((keyName == null) || (keyName.length() == 0)) {            for (int i = 0; i < rules.length; i++) {                // apply the rules for automatically appending the method name                if (request.getServletPath().indexOf(rules[i]) > -1) {                    return dispatchMethod(mapping, form, request, response,                            rules[i]);                }            }            return this.unspecified(mapping, form, request, response);        }        // Identify the string to lookup        String methodName =                getMethodName(mapping, form, request, response, parameter);        return dispatchMethod(mapping, form, request, response, methodName);    }