title: What is JSP equivalent of PHP's $_server
body: <p>This question might sound similar to </p>
  
  <p><a href="https://stackoverflow.com/questions/779403/jsp-or-javascript-equivalent-to-phps-serverhttp-host">JSP or JavaScript equivalent to PHP&#39;s $_SERVER[&quot;HTTP_HOST&quot;]?</a> </p>
  
  <p>But the answers to that questions are only about finding out HTTP_HOST.</p>
  
  <p>I am wondering if it is possible to create Sever-wide global variables in JSP. </p>
  
  <p>Example:</p>
  
  <p>User 1 computes some user independent function X. It is likely that other users too might visit the application to compute X. One way would be I can save it in mySQL and for subsequent user requests do a db lookup. But I dont want to use any DB and my data should persist only during the lifetime of the server. </p>
  
  <p>In PHP I could simple set $_SERVER['x]=value; </p>
  
  <p>I was wondering if similar thing can be achieved in JSP. </p>