Package org.exist.http.servlets

Examples of org.exist.http.servlets.SessionWrapper


    final JavaObjectValue session = (JavaObjectValue) var.getValue().itemAt(0);
   
    if(session.getObject() instanceof SessionWrapper)
    {
      final ValueSequence result = new ValueSequence();
      final SessionWrapper sessionWrapper = (SessionWrapper)session.getObject();
      for(final Enumeration<String> e = sessionWrapper.getAttributeNames(); e.hasMoreElements();)
      {
        final String attribName = e.nextElement();
        result.add(new StringValue(attribName));
      }
      return result;
View Full Code Here


      {throw new XPathException(this, "Variable $session is not bound to an Java object.");}
    final JavaObjectValue session = (JavaObjectValue) var.getValue().itemAt(0);
   
    if(session.getObject() instanceof SessionWrapper)
    {
      final SessionWrapper sessionWrapper = (SessionWrapper)session.getObject();
      for(final Enumeration<String> e = sessionWrapper.getAttributeNames(); e.hasMoreElements();)
      {
        final String attribName = (String) e.nextElement();
        sessionWrapper.removeAttribute(attribName);
      }
      return Sequence.EMPTY_SEQUENCE;
    }
    else
      {throw new XPathException(this, "Type error: variable $session is not bound to a session object");}
View Full Code Here

//      if (user == null)
//        return Sequence.EMPTY_SEQUENCE;

      //validated user, store in session
      context.getBroker().setUser(user);
      final SessionWrapper session = request.getSession(true);
      session.setAttribute("user", userName);
      session.setAttribute("password", new StringValue(passwd));
      return BooleanValue.TRUE;
    }
    else
    {
      throw new XPathException(this, "Variable $request is not bound to a Request object.");
View Full Code Here

  {
    final SessionModule sessionModule = (SessionModule)context.getModule( SessionModule.NAMESPACE_URI );
        Variable var = sessionModule.resolveVariable( SessionModule.SESSION_VAR );
   
    if( createSession && ( var == null || var.getValue() == null ) ) {
      SessionWrapper session  = null;
      final RequestModule reqModule = (RequestModule)context.getModule( RequestModule.NAMESPACE_URI );
   
      // request object is read from global variable $request
      final Variable reqVar = reqModule.resolveVariable( RequestModule.REQUEST_VAR );
     
View Full Code Here

    }
    if(var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, SessionModule.SESSION_VAR + " is not bound to a Java object.");}
    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if(value.getObject() instanceof SessionWrapper) {
      final SessionWrapper session = (SessionWrapper)value.getObject();
      session.invalidate();
      return Sequence.EMPTY_SEQUENCE;
    } else
      {throw new XPathException(this, SessionModule.SESSION_VAR + " is not bound to a session object");}
    }
View Full Code Here

    final JavaObjectValue value = (JavaObjectValue)var.getValue().itemAt( 0 );
   
    if( value.getObject() instanceof RequestWrapper ) {
      final SessionModule  sessionModule   = (SessionModule)context.getModule( SessionModule.NAMESPACE_URI );
      final SessionWrapper session       = ((RequestWrapper)value.getObject()).getSession( true );
     
      sessionModule.declareVariable( SessionModule.SESSION_VAR, session );
      ret = (JavaObjectValue)sessionModule.resolveVariable( SessionModule.SESSION_VAR ).getValue().itemAt( 0 );
    } else {
      throw( new XPathException( fn, "Variable $request is not bound to a Request object." ) );
View Full Code Here

TOP

Related Classes of org.exist.http.servlets.SessionWrapper

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.