Package net.sourceforge.stripes.action

Examples of net.sourceforge.stripes.action.RedirectResolution


       
        try{
        service.create(user);}
        catch(PersistenceException ex){
            getContext().getMessages().add(new LocalizableError("usernameTaken", user));
            return new RedirectResolution("/registration.jsp?reg_error=1");
        }
       
        getContext().getMessages().add(new LocalizableError(
        getClass().getName() + ".successMessage", this.user.getName(), this.user.getPassword()
            ));
    return new RedirectResolution("/login.jsp");
    }
View Full Code Here


       
        try{
        service.create(user);}
        catch(PersistenceException ex){
            getContext().getMessages().add(new LocalizableError("usernameTaken", user));
            return new RedirectResolution("/registration.jsp?reg_error=1");
        }
       
        getContext().getMessages().add(new LocalizableError(
        getClass().getName() + ".successMessage", this.user.getName(), this.user.getPassword()
            ));
    return new RedirectResolution("/login.jsp");
    }
View Full Code Here

public class DDTroopsExceptionHandler extends DefaultExceptionHandler {
    public Resolution handleConstrainViolationException(JpaSystemException exc, HttpServletRequest request, HttpServletResponse response) {

        Pattern p = Pattern.compile("/(?<name>\\w+)/.*");
        Matcher matcher = p.matcher(request.getServletPath());
        return new RedirectResolution(matcher.replaceAll("/${name}/all?error=constraint"));
    }
View Full Code Here

    /** A very simple add event that returns a Redirect reslution. */
    @HandlesEvent("addAndRedirect")
    public Resolution addAndRedirect() {
        this.result = lhs + rhs;
        return new RedirectResolution("/mock/success.jsp");
    }
View Full Code Here

        accountService.changePreferences(userInformation.getUserId(), newPreferences);
        getContext().setUserInformation(
            userInformation.withPreferences(newPreferences));
        getContext().getMessages().add(new ScopedLocalizableMessage(ChangePreferredLocaleActionBean.class,
                                                                    "preferredLocaleChanged"));
        return new RedirectResolution(PreferencesActionBean.class);
    }
View Full Code Here

     * Cancels the change
     * @return a redirect resolution to the preferences page
     */
    @DontBind
    public Resolution cancel() {
        return new RedirectResolution(PreferencesActionBean.class);
    }
View Full Code Here

            TimeZone timeZone = getContext().getTimeZone();
            DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, getContext().getLocale());
            dateFormat.setTimeZone(timeZone);
            DateFormat timeFormat = DateFormat.getTimeInstance(DateFormat.MEDIUM, getContext().getLocale());
            timeFormat.setTimeZone(timeZone);
            RedirectResolution loginHistoryResolution = new RedirectResolution(LoginHistoryActionBean.class);
            String loginHistoryUrl =
                StringEscapeUtils.escapeHtml(
                     loginHistoryResolution.getUrl(getContext().getLocale()));
            getContext().getMessages().add(new ScopedLocalizableMessage(LoginActionBean.class,
                                                                        "loginSucceededWithLastLogin",
                                                                        dateFormat.format(historicLogin.getDate()),
                                                                        timeFormat.format(historicLogin.getDate()),
                                                                        historicLogin.getIp(),
                                                                        loginHistoryUrl));
        }

        if (requestedUrl != null) {
            return new RedirectResolution(requestedUrl, false);
        }

        return new RedirectResolution(CardsActionBean.class);
    }
View Full Code Here

     * @return a redirect resolution to the welcome page
     */
    @DontValidate
    public Resolution logout() {
        getContext().logout();
        return new RedirectResolution(IndexActionBean.class);
    }
View Full Code Here

                                      newPassword,
                                      getContext().getUserInformation().getEncryptionKey());
        getContext().getMessages().add(new ScopedLocalizableMessage(
            ChangeMasterPasswordActionBean.class,
            "masterPasswordChanged"));
        return new RedirectResolution(AccountActionBean.class);
    }
View Full Code Here

     * Cancels the change
     * @return a redirect resolution to the account page
     */
    @DontBind
    public Resolution cancel() {
        return new RedirectResolution(AccountActionBean.class);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.action.RedirectResolution

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.