Package org.apache.turbine.modules.actions.sessionvalidator

Examples of org.apache.turbine.modules.actions.sessionvalidator.SessionValidator


            // initialization.  Certain services need RunData to initialize
            // themselves.
            init(data);

            // Get the instance of the Session Validator.
            SessionValidator sessionValidator = (SessionValidator)ActionLoader
                .getInstance().getInstance(TurbineResources.getString(
                    "action.sessionvalidator"));

            // if this is the redirected stage of the initial request,
            // check that the session is now not new.
            // If it is not, then redirect back to the
            // original URL (i.e. remove the "redirected" pathinfo)
            if (data.getParameters()
                .getString(REDIRECTED_PATHINFO_NAME, "false").equals("true"))
            {
                if (data.getSession().isNew())
                {
                    String message = "Infinite redirect detected...";
                    log(message);
                    Log.error(message);
                    throw new Exception(message);
                }
                else
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
                    for (Enumeration e = data.getParameters().keys() ;
                         e.hasMoreElements() ;)
                    {
                        String key = (String) e.nextElement();
                        if (!key.equals(REDIRECTED_PATHINFO_NAME))
                        {
                            String value =
                                (String) data.getParameters().getString ( key );
                            duri.addPathInfo((String)key, (String)value );
                        }
                    }

                    data.getResponse().sendRedirect( duri.toString() );
                    return;
                }
            }
            else
            {
                // Insist that the client starts a session before access
                // to data is allowed. this is done by redirecting them to
                // the "screen.homepage" page but you could have them go
                // to any page as a starter (ie: the homepage)
                // "data.getResponse()" represents the HTTP servlet
                // response.
                if ( sessionValidator.requiresNewSession(data) &&
                     data.getSession().isNew() )
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
View Full Code Here


    {
        if (rundata == null)
            throw new NullPointerException("rundata is null");
       
        // Get the instance of the Session Validator.
        SessionValidator sessionValidator = (SessionValidator)ActionLoader
             .getInstance().getInstance(TurbineResources.getString(
                 "action.sessionvalidator"));
        if (sessionValidator == null)
            throw new NullPointerException("Failed to get a SessonValidator");
View Full Code Here

    {
        if (rundata == null)
            throw new NullPointerException("rundata is null");
       
        // Get the instance of the Session Validator.
        SessionValidator sessionValidator = (SessionValidator)ActionLoader
             .getInstance().getInstance(TurbineResources.getString(
                 "action.sessionvalidator"));
        if (sessionValidator == null)
            throw new NullPointerException("Failed to get a SessonValidator");
View Full Code Here

            // initialization.  Certain services need RunData to initialize
            // themselves.
            init(data);

            // Get the instance of the Session Validator.
            SessionValidator sessionValidator = (SessionValidator)ActionLoader
                .getInstance().getInstance(TurbineResources.getString(
                    "action.sessionvalidator"));

            // if this is the redirected stage of the initial request, check that
            // the session is now not new. If it is not, then redirect back to the
            // original URL (i.e. remove the "redirected" pathinfo)
            if (data.getParameters().getString(REDIRECTED_PATHINFO_NAME, "false")
                    .equals("true"))
            {
                if (data.getSession().isNew())
                {
                    String message = "Infinite redirect detected...";
                    log(message);
                    Log.error(message);
                    throw new Exception(message);
                }
                else
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
                    for (Enumeration e = data.getParameters().keys() ;
                         e.hasMoreElements() ;)
                    {
                        String key = (String) e.nextElement();
                        if (!key.equals(REDIRECTED_PATHINFO_NAME))
                        {
                            String value =
                                (String) data.getParameters().getString ( key );
                            duri.addPathInfo((String)key, (String)value );
                        }
                    }

                    data.getResponse().sendRedirect( duri.toString() );
                    return;
                }
            }
            else
            {
                // Insist that the client starts a session before access
                // to data is allowed. this is done by redirecting them to
                // the "screen.homepage" page but you could have them go
                // to any page as a starter (ie: the homepage)
                // "data.getResponse()" represents the HTTP servlet
                // response.
                if ( sessionValidator.requiresNewSession(data) &&
                        data.getSession().isNew() )
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
View Full Code Here

            // initialization.  Certain services need RunData to initialize
            // themselves.
            init(data);

            // Get the instance of the Session Validator.
            SessionValidator sessionValidator = (SessionValidator)ActionLoader
                .getInstance().getInstance(TurbineResources.getString(
                    "action.sessionvalidator"));

            // if this is the redirected stage of the initial request,
            // check that the session is now not new.
            // If it is not, then redirect back to the
            // original URL (i.e. remove the "redirected" pathinfo)
            if (data.getParameters()
                .getString(REDIRECTED_PATHINFO_NAME, "false").startsWith("true"))
            {
                if (data.getSession().isNew())
                {
                    String message = "Infinite redirect detected...";
                    log(message);
                    Log.error(message);
                    throw new Exception(message);
                }
                else
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
                    for (Enumeration e = data.getParameters().keys() ;
                         e.hasMoreElements() ;)
                    {
                        String key = (String) e.nextElement();
                        if (!key.equals(REDIRECTED_PATHINFO_NAME))
                        {
                            String value =
                                (String) data.getParameters().getString ( key );
                            duri.addPathInfo((String)key, (String)value );
                        }
                    }

                    data.getResponse().sendRedirect( duri.toString() );
                    return;
                }
            }
            else
            {
                // Insist that the client starts a session before access
                // to data is allowed. this is done by redirecting them to
                // the "screen.homepage" page but you could have them go
                // to any page as a starter (ie: the homepage)
                // "data.getResponse()" represents the HTTP servlet
                // response.
                if ( sessionValidator.requiresNewSession(data) &&
                     data.getSession().isNew() )
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
View Full Code Here

            // initialization.  Certain services need RunData to initialize
            // themselves.
            init(data);

            // Get the instance of the Session Validator.
            SessionValidator sessionValidator = (SessionValidator)ActionLoader
                .getInstance().getInstance(TurbineResources.getString(
                    "action.sessionvalidator"));

            // if this is the redirected stage of the initial request,
            // check that the session is now not new.
            // If it is not, then redirect back to the
            // original URL (i.e. remove the "redirected" pathinfo)
            if (data.getParameters()
                .getString(REDIRECTED_PATHINFO_NAME, "false").equals("true"))
            {
                if (data.getSession().isNew())
                {
                    String message = "Infinite redirect detected...";
                    log(message);
                    Log.error(message);
                    throw new Exception(message);
                }
                else
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
                    for (Enumeration e = data.getParameters().keys() ;
                         e.hasMoreElements() ;)
                    {
                        String key = (String) e.nextElement();
                        if (!key.equals(REDIRECTED_PATHINFO_NAME))
                        {
                            String value =
                                (String) data.getParameters().getString ( key );
                            duri.addPathInfo((String)key, (String)value );
                        }
                    }

                    data.getResponse().sendRedirect( duri.toString() );
                    return;
                }
            }
            else
            {
                // Insist that the client starts a session before access
                // to data is allowed. this is done by redirecting them to
                // the "screen.homepage" page but you could have them go
                // to any page as a starter (ie: the homepage)
                // "data.getResponse()" represents the HTTP servlet
                // response.
                if ( sessionValidator.requiresNewSession(data) &&
                     data.getSession().isNew() )
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
View Full Code Here

            // initialization.  Certain services need RunData to initialize
            // themselves.
            init(data);

            // Get the instance of the Session Validator.
            SessionValidator sessionValidator = (SessionValidator)ActionLoader
                .getInstance().getInstance(TurbineResources.getString(
                    "action.sessionvalidator"));

            // if this is the redirected stage of the initial request,
            // check that the session is now not new.
            // If it is not, then redirect back to the
            // original URL (i.e. remove the "redirected" pathinfo)
            if (data.getParameters()
                .getString(REDIRECTED_PATHINFO_NAME, "false").equals("true"))
            {
                if (data.getSession().isNew())
                {
                    String message = "Infinite redirect detected...";
                    log(message);
                    Log.error(message);
                    throw new Exception(message);
                }
                else
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
                    for (Enumeration e = data.getParameters().keys() ;
                         e.hasMoreElements() ;)
                    {
                        String key = (String) e.nextElement();
                        if (!key.equals(REDIRECTED_PATHINFO_NAME))
                        {
                            String value =
                                (String) data.getParameters().getString ( key );
                            duri.addPathInfo((String)key, (String)value );
                        }
                    }

                    data.getResponse().sendRedirect( duri.toString() );
                    return;
                }
            }
            else
            {
                // Insist that the client starts a session before access
                // to data is allowed. this is done by redirecting them to
                // the "screen.homepage" page but you could have them go
                // to any page as a starter (ie: the homepage)
                // "data.getResponse()" represents the HTTP servlet
                // response.
                if ( sessionValidator.requiresNewSession(data) &&
                     data.getSession().isNew() )
                {
                    DynamicURI duri = new DynamicURI (data, true);

                    // Pass on the sent data in pathinfo.
View Full Code Here

TOP

Related Classes of org.apache.turbine.modules.actions.sessionvalidator.SessionValidator

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.