title: Converting a Scala Session Object to a Java Session Object in Play Framework
body: <p>Is there a way to convert the <strong>session object in scala to the session object in java</strong> in <strong>Play</strong>?</p>
  
  <p>I have a <code>Model method</code> written in <code>java</code> like : </p>
  
  <pre><code>public void DoSomething(Request request, Session session)
  {
         String fancyValue = request.getQueryString("userInput");
         session.put("Some Fancy Stuff",fancyValue);
  }
  </code></pre>
  
  <p>and a <code>Controller</code> method written in <code>scala</code> like:</p>
  
  <pre><code>def showHomePage = Action { implicit request =&gt;
  
       val JRequest = play.core.j.JavaHelpers.createJavaRequest(request)
       val JSession // conversion needed from request.session to play.mvc.Http.Session
  
       new SomeModel().DoSomething(JRequest,JSession)
  
       // would this include the updates done to the session in the java model?
       Ok("Testing Stuff").withSession(session) 
  }
  </code></pre>