Package org.apache.struts.action

Examples of org.apache.struts.action.ActionMessages


        LogonControllerFactory.getInstance().applyMenuItemChanges(request);

        // Go to the set password page if this is a new account and set password was selected
        if (udb.supportsPasswordChange() && (account.isSetPassword() || !account.getEditing())) {
            request.getSession().setAttribute("setPassword.user", user);
            ActionMessages msgs = new ActionMessages();
            msgs.add(Globals.MESSAGE_KEY, new ActionMessage("createAccount.message.accountSaved"));
            saveMessages(request, msgs);
            return mapping.findForward("setPassword");
        } else {
            return new RedirectWithMessages(mapping.findForward("success"), request);
        }
View Full Code Here


                    request.setAttribute(Constants.REQ_ATTR_ACTION_MAPPING, mapping);
                    request.setAttribute(Constants.REQ_ATTR_FORM, form);

                    int logonStatus = LogonControllerFactory.getInstance().hasClientLoggedOn(request, response);
                    if (logonStatus == LogonController.INVALID_TICKET) {
                        ActionMessages msgs = new ActionMessages();
                        msgs.add(Globals.ERROR_KEY, new ActionMessage("login.invalidTicket"));
                        saveErrors(request, msgs);
                    } else if (logonStatus == LogonController.LOGGED_ON) {
                        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
                        // Set the logon ticket / domain logon ticket again
                        LogonControllerFactory.getInstance().addCookies(new ServletRequestAdapter(request),
View Full Code Here

    protected void saveError(HttpServletRequest request, String message, Object... objects) {
        saveError(request, new ActionMessage(message, objects));
    }

    protected void saveError(HttpServletRequest request, ActionMessage message) {
        ActionMessages actionMessages = new ActionMessages();
        actionMessages.add(Globals.ERROR_KEY, message);
        saveErrors(request, actionMessages);       
    }
View Full Code Here

    protected void saveMessage(HttpServletRequest request, String message ) {
        saveMessage(request, message, "");
    }

    protected void saveMessage(HttpServletRequest request, String message, Object... objects) {
        ActionMessages actionMessages = new ActionMessages();
        actionMessages.add(Globals.MESSAGE_KEY, new ActionMessage(message, objects));
        saveMessages(request, actionMessages);
    }
View Full Code Here

                    roles = copy;
                    saveMessage(request, "availableRoles.match.limited", maxRoleResults);
                }
            } catch (Exception e) {
                log.error("Failed to get available roles.", e);
                ActionMessages errs = new ActionMessages();
                errs.add(Globals.ERROR_KEY, new ActionMessage("availableRoles.cannotListRoles", Util.getExceptionMessageChain(e)));
                saveErrors(request, errs);
                roles = new Role[0];
            }
            showAvailableRolesForm.initialize(roles, request.getSession());
            ActionMessages msgs = new ActionMessages();
            if (!userDatabase.supportsAccountCreation()) {
                msgs.add(Globals.MESSAGE_KEY, new ActionMessage("availableRoles.noRoleCreation.text"));
            }
            if (msgs.size() > 0) {
                saveMessages(request, msgs);
            }
        } catch (Exception ex) {
            log.error("Failed to reset administration form", ex);
        }
View Full Code Here

    public ActionForward confirmRoleDeletion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    PolicyUtil.checkPermission(PolicyConstants.ACCOUNTS_AND_GROUPS_RESOURCE_TYPE, PolicyConstants.PERM_DELETE, request);
    String rolename = request.getParameter("rolename");
    if (rolename == null) {
      ActionMessages mesgs = new ActionMessages();
      mesgs.add(Globals.ERROR_KEY, new ActionMessage("availableRoles.singleRoleNotSelected"));
      saveErrors(request, mesgs);
      return list(mapping, form, request, response);
    } else {
      return mapping.findForward("confirmRoleDeletion");
    }
View Full Code Here

    ((SetPasswordForm) form).initialize(user);
    if (((SetPasswordForm) form).getReferer() == null) {
      ((SetPasswordForm) form).setReferer(getReferer(request));
    }
    request.getSession().removeAttribute("setPassword.user");
    ActionMessages messages = new ActionMessages();
    messages.add(Globals.MESSAGE_KEY,
      new ActionMessage("setPassword.message.passwordPolicy",
              Property.getProperty(new RealmKey("security.password.pattern.description", user.getRealm()
                      .getResourceId()))));
    saveMessages(request, messages);
    CoreUtil.addRequiredFieldMessage(this, request);
View Full Code Here

            shutdownForm.setReferer(referer);
        }

        int users = LogonControllerFactory.getInstance().getActiveSessions().size();
        if (users > 1) {
            ActionMessages msgs = new ActionMessages();
            msgs.add(Globals.MESSAGE_KEY, new ActionMessage("shutdown.userWarning", new Integer(users)));
            saveMessages(request, msgs);
        }

        return mapping.findForward("display");
    }
View Full Code Here

     */
    public static void addWarnings(HttpServletRequest request, ActionMessages warnings) {
        if (warnings == null) {
            return;
        }
        ActionMessages requestWarnings = (ActionMessages) request.getAttribute(Constants.REQ_ATTR_WARNINGS);
        if (requestWarnings == null) {
            requestWarnings = new ActionMessages();
        }
        requestWarnings.add(warnings);
        if (requestWarnings.isEmpty()) {
            request.removeAttribute(Constants.REQ_ATTR_WARNINGS);
            return;
        }
        request.setAttribute(Constants.REQ_ATTR_WARNINGS, requestWarnings);
    }
View Full Code Here

    } else {
     
      try {
        if (ticket.equals(this.getSessionInfo(request).getLogonTicket())) {
          log.error("You cannot log yourself off.");
          ActionMessages mesgs = new ActionMessages();
          mesgs.add(Globals.ERROR_KEY, new ActionMessage("status.sessions.cannotLogoffYourself"));
          saveErrors(request, mesgs);
          return new RedirectWithMessages(mapping.findForward("success"), request);
        }
        Map map = LogonControllerFactory.getInstance().getActiveSessions();
        synchronized (map) {
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionMessages

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.