Package org.apache.tapestry.web

Examples of org.apache.tapestry.web.WebSession


        throw new UnsupportedOperationException(PortletMessages.unsupportedMethod("getLink"));
    }

    public void service(IRequestCycle cycle) throws IOException
    {
        WebSession session = _request.getSession(true);
        String markup = (String) session
                .getAttribute(PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE);

        PrintWriter writer = _response.getPrintWriter(new ContentType("text/html"));

        PortletURL url = _globals.getRenderResponse().createActionURL();
View Full Code Here


        // #2: Get it, wreate is true, it is wreated.

        replayControls();

        WebSession cs = wr.getSession(true);

        verifyControls();

        // #3: Cached in local variable, make sure same
        // think returned.
View Full Code Here

    public void store(String pageName, String idPath, String propertyName, Object newValue)
    {
        Defense.notNull(pageName, "pageName");
        Defense.notNull(propertyName, "propertyName");

        WebSession session = _request.getSession(true);

        StringBuffer buffer = new StringBuffer();

        buffer.append(_applicationId);
        buffer.append(",");
        buffer.append(pageName);

        if (idPath != null)
        {
            buffer.append(",");
            buffer.append(idPath);
        }

        buffer.append(",");
        buffer.append(propertyName);

        String key = buffer.toString();

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

    public Collection getStoredChanges(String pageName, IRequestCycle cycle)
    {
        Defense.notNull(pageName, "pageName");

        WebSession session = _request.getSession(false);

        if (session == null)
            return Collections.EMPTY_LIST;

        Collection result = new ArrayList();

        String prefix = _applicationId + "," + pageName + ",";

        Iterator i = session.getAttributeNames().iterator();
        while (i.hasNext())
        {
            String key = (String) i.next();

            if (key.startsWith(prefix))
            {
                PropertyChange change = buildChange(key, session.getAttribute(key));

                result.add(change);
            }
        }
View Full Code Here

    public void discardStoredChanges(String pageName, IRequestCycle cycle)
    {
        Defense.notNull(pageName, "pageName");

        WebSession session = _request.getSession(false);

        if (session == null)
            return;

        String prefix = _applicationId + "," + pageName + ",";

        Iterator i = session.getAttributeNames().iterator();
        while (i.hasNext())
        {
            String key = (String) i.next();

            if (key.startsWith(prefix))
                session.setAttribute(key, null);
        }
    }
View Full Code Here

        return session;
    }

    protected WebSession newWebSession(boolean isNew)
    {
        WebSession session = newWebSession();

        session.isNew();
        setReturnValue(session, isNew);

        return session;
    }
View Full Code Here

        verifyControls();
    }

    public void testExists()
    {
        WebSession session = newSession("state:testapp:fred", "XXX");
        WebRequest request = newRequest(false, session);

        replayControls();

        SessionScopeManager m = new SessionScopeManager();
View Full Code Here

    }

    public void testGetExists()
    {
        Object stateObject = new Object();
        WebSession session = newSession("state:testapp:fred", stateObject);
        WebRequest request = newRequest(session);

        replayControls();

        SessionScopeManager m = new SessionScopeManager();
View Full Code Here

    public void testGetAndCreate()
    {
        Object stateObject = new Object();
        StateObjectFactory factory = newFactory(stateObject);

        WebSession session = newSession();

        trainGetAttribute(session, "state:myapp:fred", null);

        session.setAttribute("state:myapp:fred", stateObject);

        WebRequest request = newRequest(session);

        replayControls();
View Full Code Here

    public void testStore()
    {
        Object stateObject = new Object();

        WebSession session = newSession();

        session.setAttribute("state:myapp:fred", stateObject);

        WebRequest request = newRequest(session);

        replayControls();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.web.WebSession

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.