Example usage for org.apache.wicket.util.cookies CookieUtils load

List of usage examples for org.apache.wicket.util.cookies CookieUtils load

Introduction

In this page you can find the example usage for org.apache.wicket.util.cookies CookieUtils load.

Prototype

public final String load(final FormComponent<?> formComponent) 

Source Link

Document

Retrieve the cookie value associated with the formComponent and load the model object with the cookie value.

Usage

From source file:dk.frankbille.scoreboard.ScoreBoardSession.java

License:Open Source License

public ScoreBoardSession(Request request) {
    super(request);
    Injector.get().inject(this);

    CookieUtils cookieUtils = new CookieUtils();
    String loginUsername = cookieUtils.load("loginUsername");
    String loginPassword = cookieUtils.load("loginPassword");
    if (false == Strings.isEmpty(loginUsername) && false == Strings.isEmpty(loginPassword)) {
        authenticate(loginUsername, loginPassword);
    }//from w  ww . j ava  2 s.c o m
}

From source file:dk.teachus.frontend.TeachUsSession.java

License:Apache License

public TeachUsSession(Request request) {
    super(request);

    CookieUtils cookieUtils = new CookieUtils();
    String username = cookieUtils.load("username");
    String password = cookieUtils.load("password");
    if (false == Strings.isEmpty(username) && false == Strings.isEmpty(password)) {
        signIn(username, password);/*from  ww  w . j av  a2s  .  c o m*/
    } else {
        changeLocale(getLocale());
    }
}

From source file:org.apache.isis.viewer.wicket.ui.components.widgets.themepicker.ThemeChooser.java

License:Apache License

private void initializeActiveThemeFromCookie() {
    CookieUtils cookieUtils = new CookieUtils();
    String activeTheme = cookieUtils.load(ISIS_THEME_COOKIE_NAME);
    if (!Strings.isEmpty(activeTheme)) {
        setActiveTheme(activeTheme);//from  ww w . ja  v a2s. c o m
    }
}

From source file:org.apache.isis.viewer.wicket.ui.pages.login.WicketSignInPage.java

License:Apache License

/**
 * Checks for a cookie with name {@value #FEEDBACK_COOKIE_NAME} that is
 * used as a temporary container for stateless session scoped success feedback
 * messages.//from   w ww  . j a  v  a  2s  . c  o m
 */
private void checkForSuccessFeedback() {
    CookieUtils cookieUtils = new CookieUtils();
    String successFeedback = cookieUtils.load(FEEDBACK_COOKIE_NAME);
    if (!Strings.isEmpty(successFeedback)) {
        success(successFeedback);
        cookieUtils.remove(FEEDBACK_COOKIE_NAME);
    }
}