title: Accessing JSP variable from javascript [Angular JS]
body: <p>I am working with angular JS and JSP. i need to retrieve the session attribute variable from the JSP to my controller. My code is below</p>
  
  <p><strong>JSP</strong></p>
  
  <pre><code>&lt;html lang="en" ng-app="myApp"&gt;
  &lt;body&gt;
      &lt;div data-ng-controller="myCtrl as vm" style="height:100%"&gt;
          &lt;md-content layout="row" style="height:100%"&gt;
              &lt;div class="widget"&gt;
                  &lt;h2&gt;Header&lt;/h2&gt;
                  &lt;div ui-view&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/md-content&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript" src="/root/script/script.js"&gt;&lt;/script&gt;
    &lt;%
    String policy = session.getAttribute("POLICY_CHANGE");
    %&gt; 
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope) {
     // i want to get the JSP variable here
  });
  </code></pre>