Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.Session


        if (componentId != null) builder.append(componentId);

        builder.append(':');
        builder.append(fieldName);

        Session session = _request.getSession(true);

        session.setAttribute(builder.toString(), newValue);
    }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public <T> T get(Class<T> asoClass, ApplicationStateCreator<T> creator)
    {
        Session session = getSession();

        String key = buildKey(asoClass);

        T aso = (T) session.getAttribute(key);

        if (aso == null)
        {
            aso = creator.create();
            session.setAttribute(key, aso);
        }

        return aso;
    }
View Full Code Here

    public <T> boolean exists(Class<T> asoClass)
    {
        String key = buildKey(asoClass);

        Session session = _request.getSession(false);

        return session != null && session.getAttribute(key) != null;
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.Session

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.