title: Using scala and java in play framework 2.1 : Session usage
body: <p>I'm currently using the <code>session()</code> of play framework in my template :</p>
  
  <pre><code>@if(session().get("email")==null){
      &lt;li&gt;&lt;a href="@controllers.routes.General.login"&gt;Login&lt;/a&gt;&lt;/li&gt;
  }else{
      &lt;li&gt;&lt;a href="@controllers.routes.General.logout"&gt;Logout&lt;/a&gt;&lt;/li&gt;
  }
  </code></pre>
  
  <p>This template is used in all of my views. Some of these views are controlled by a Java controller, and some are with a Scala controller.</p>
  
  <p>When I click on links that lead to Java controllers, I have no problems, the links for login and logout are correctly handled.</p>
  
  <p>When I click on links that lead to Scala controllers, I get a [<code>RuntimeException: There is no HTTP Context available from here.]</code> </p>
  
  <p>From what I read in here about scala controllers, I understood that they didn't return the http context when rendering a page, but I really want to be able to use the session in my template.</p>
  
  <p>I thought about using an argument <code>session()</code> in my view, templates and controllers, but I believe that there will be a conflict between the java session (play.mvc.http.session) and the scala session (play.api.mvc.session) when play will compile the html pages.</p>
  
  <p>Am I stuck? Is there a possibility to force scala controllers to give back the http context ?</p>