title: Spring-mvc 3.0 application session scope
body: <p>While using left menu I am not redirecting to the other page but using href to link other pages. But while doing that my session scope which is limited to request no longer exists.
  So here is my controller code:</p>
  
  <p>Setting the session:</p>
  
  <pre><code>request.getSession(true).setAttribute("application", application);
  </code></pre>
  
  <p>Getting the session Object in other controller:</p>
  
  <pre><code>HttpSession session = request.getSession();
  session.getAttribute("application"); //application null in href; redirect works fine
  </code></pre>
  
  <p>So is there any way I can use "application" session scope in Spring MVC 3. So that I can have the access to session through out my application.</p>
  
  <p>I tried this code snippet in my application-servlet.xml </p>
  
  <pre><code>&lt;!-- a HTTP Session-scoped bean exposed as a proxy --&gt; 
  &lt;bean id="applicationVO" class="com.nypd.viewobjects.ApplicationVO" scope="globalSession"&gt; 
  &lt;!-- this next element effects the proxying of the surrounding bean --&gt; 
  &lt;aop:scoped-proxy/&gt; 
  &lt;/bean&gt; 
  </code></pre>
  
  <p>I am injecting the object to set and retrieve the simple bean as below:</p>
  
  <pre><code>@Autowired private ApplicationVO applicationVO;
  </code></pre>
  
  <p>what I am I doing wrong here ?</p>
  
  <p>I also tried <code>@SessionAttribute</code> on the controller
  <code>@SessionAttributes("applicationVO")</code> but it seems the problem still exists.</p>
  
  <p>I will deeply appreciate if anyone can provide me a small example with two controllers.</p>