title: RequestParam and sessions Spring MVC
body: <p>i have one question i'm using</p>
  
  <pre><code>  @RequestMapping(value = "/user", method = RequestMethod.GET)
    public String getUser(@RequestParam("id"), Model model){
  
    }
  </code></pre>
  
  <p>this means that when i'll give the url/user?id=1</p>
  
  <p>that will give me back some data.
  Now in the login i'm taking this id and i save it in a session.</p>
  
  <pre><code>   session.setAttribute("userId", result.getBody().getId());
  </code></pre>
  
  <p>and i want when a user click at a tab automatically to be bind the id with the attribute stored in the session. i.e. lets say that the userId has as value 1. Then when i'll click on the tab to redirected automatically to:url/user?id=1
  How can i do this?</p>
  
  <p>For the tab i have this one:</p>
  
  <pre><code>&lt;a href="&lt;c:url value='/user'/&gt;"
  </code></pre>