Package com.company.ui

Source Code of com.company.ui.HomePage

package com.company.ui;

import java.io.IOException;

import org.rendersnake.HtmlCanvas;
import org.rendersnake.Renderable;
import org.rendersnake.RequestUtils;

import com.company.ui.login.LoginForm;

public class HomePage implements Renderable {

    public void renderOn(HtmlCanvas html) throws IOException {
       
        boolean isAuthenticated = RequestUtils.getSession(html).getBoolean("authenticated", false);
       
        if (isAuthenticated) {
            html.h1().content("Hello " + RequestUtils.getSession(html).getString("user"));
        } else {
            html.render(new LoginForm());
        }
       
        html.h4().content("quickstart example app using renderSnake and Google Guice");
    }
}
TOP

Related Classes of com.company.ui.HomePage

TOP
Copyright © 2018 www.massapi.com. 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.