title: Grails session variable null
body: <p>My app has an expensive service method, results of which must be 1) checked for errors and 2) presented to a Java applet via a URL (i.e. as opposed to a JavaScript variable). The method result is a string, and the applet is <em>only</em> capable of loading data from a file or URL.</p>
  
  <p>I tried to deal with the problem using a session variable:</p>
  
  <pre><code>def action1 = {
      def input = params['input']
      def result = expensiveServiceMethod( input )
      def failed = result == null
      session['result'] = result
      render( view:'view1', model:[failed:failed] )
  }
  
  def action2 = {
      def result = session['result']
      render( result )
  }
  </code></pre>
  
  <p>Then, in <code>view1</code> the applet is conditionally displayed depending on the failure status, and the results are accessed by the applet via the <code>action2</code> URL.</p>
  
  <p>Unfortunately, <code>result</code> in <code>action2</code> is coming up <code>null</code>. I've verified that <code>result</code> is <em>not</em> <code>null</code> in <code>action1</code>. Am I doing it wrong?</p>
  
  <p><strong>Note</strong><br>
  I would have used <code>flash</code> instead, but there are additional requests made in order to initialize the applet.</p>