Java Code Examples for com.vaadin.server.VaadinRequest#getParameter()

The following examples show how to use com.vaadin.server.VaadinRequest#getParameter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QuestionnairesUI.java    From gazpachoquest with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void init(VaadinRequest request) {
    logger.info("New Vaadin UI created");
    String invitation = request.getParameter("invitation");
    logger.info("Invitation: {} of sessions : {}", invitation);
    setSizeFull();
    GazpachoViewDisplay viewDisplay = new GazpachoViewDisplay();
    setContent(viewDisplay);

    navigator = new Navigator(this, (ViewDisplay) viewDisplay);
    navigator.addProvider(viewProvider);
    navigator.setErrorProvider(new GazpachoErrorViewProvider());

    if (isUserSignedIn()) {
        navigator.navigateTo(QuestionnaireView.NAME);
    } else {
        navigator.navigateTo(LoginView.NAME);
    }
}
 
Example 2
Source File: LoginWindow.java    From jpa-invoicer with The Unlicense 5 votes vote down vote up
@Override
public boolean handleRequest(VaadinSession session, VaadinRequest request,
        VaadinResponse response) throws IOException {
    if (request.getParameter("code") != null) {
        String code = request.getParameter("code");
        Verifier v = new Verifier(code);
        Token t = service.getAccessToken(null, v);

        OAuthRequest r = new OAuthRequest(Verb.GET,
                "https://www.googleapis.com/plus/v1/people/me");
        service.signRequest(t, r);
        Response resp = r.send();

        GooglePlusAnswer answer = new Gson().fromJson(resp.getBody(),
                GooglePlusAnswer.class);

        userSession.login(answer.emails[0].value, answer.displayName);

        close();
        VaadinSession.getCurrent().removeRequestHandler(this);

        ((VaadinServletResponse) response).getHttpServletResponse().
                sendRedirect(redirectUrl);
        return true;
    }

    return false;
}
 
Example 3
Source File: ContextmenuUI.java    From context-menu with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
    if (request.getParameter("treetable") != null) {
        setContent(new ContextMenuTreeTable());
    } else {
        final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        setContent(layout);

        layout.addComponent(createVaadin7Grid());
    }

}