ovidiu      2002/08/29 17:48:31

  Modified:    src/java/org/apache/cocoon/components/flow/javascript
                        JSCocoon.java
  Log:
  Added createSession() function to allow JavaScript flow scripts to
  create servlet sessions. Place the current JavaScript Scope in the
  newly create session.
  
  Revision  Changes    Path
  1.6       +14 -0     
xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java
  
  Index: JSCocoon.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JSCocoon.java     17 Aug 2002 01:17:19 -0000      1.5
  +++ JSCocoon.java     30 Aug 2002 00:48:31 -0000      1.6
  @@ -210,6 +210,20 @@
       interp.forwardTo(uri, bizData, kont.getWebContinuation(), environment);
     }
   
  +  public void jsFunction_createSession()
  +  {
  +    Map objectModel = environment.getObjectModel();
  +    Request request = ObjectModelHelper.getRequest(objectModel);
  +    Session session = request.getSession(true);
  +
  +    // Set the Scope object in the session object of the current
  +    // user. This effectively means that at the next invocation from
  +    // the sitemap of a JavaScript function (using the <map:call
  +    // function="...">), will obtain the same scope as the current
  +    // one.
  +    session.setAttribute(JavaScriptInterpreter.USER_GLOBAL_SCOPE, scope);
  +}
  +
     public void jsFunction_diplayAllContinuations()
       throws ComponentException
     {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to