title: True difference between pageContext.getSession().setAttribute() and pageContext.setAttribute()
body: <p>I have been going crazy about resetting some validation error on one of my jsp pages. This is a project inherited from people I cannot reach anymore (dead or unavailable). I have a jsp page with lots of custom taglibs where further pages are added as tabs and the parent page has action buttons to open things like forms. There is a validation error and some configuration parameter being set/modified both in the tabs section and the parent page. But the interesting thing is that I can see the heavy use of <code>pageContext.setAttribute()</code>, <code>session.setAttribute()</code> and <code>pageContext.getSession().setAttribute()</code>. If my initial knowledge is right, <code>pageContext</code> is quite heavily used in servlet-based implementations. but how different things would be if I use those following three on my JSp pages to set attributes?</p>
  
  <p>** Example Scenario (my problem): **</p>
  
  <p>I have some attributes set in the parent page, which are also being set/modifed in the tabs page (embedded in the parent page). I want to remove them such that if there is a validation error, I will simply remove what I have in the tabs page i.e. next time the page will simply load those attributes from the parent page. Do I use <code>pageContext.setAttribute()</code> in the tabs page, but use <code>pageContext.getSession().setAttribute()</code> in the parent page? </p>
  
  <p>KR,</p>