title: Avoiding HTTP session with legacy code in tomcat/servlet
body: <p>I'm told to use some 3rd party software that consists of a servlet and a taglib. The servlet generates search results and the taglib renders results and other interaction elements according to the servlet.</p>
  
  <p>The problem is that the 3rd party solution is implemented with http sessions, means the servlet does the search, stores the result in the session, sends a redirect to the browser and on the view page (within a complete separate http request) the results from the session are shown.</p>
  
  <p>I'd like to get rid of the session because this won't work with multiple tabs and has several other disadvantages. But servlet and taglib are delivered as-is and if I need something different I have to implement it on my own from scratch.</p>
  
  <p>Any idea how I could achieve this to happen in one request, so that the session is not needed? In best case, without changing the code but with just a wrapper around. It could accept that the server creates a session, but I don't want the browser to depend on it.</p>
  
  <p>One idea I have is using the request-dispatcher to do the servlet call and the view in one http request, but still the software uses sessions. I could then discard the session after every request. Better ideas are highly appreciated.</p>
  
  <p>Of course I know, the best would be to implement it right without sessions to my requirements. But business as usual, we try to avoid spending too much time..</p>
  
  <p>Thanks in advance, have a nice evening
  Michel</p>