With a servlet filter you have the code to store the id just in one place. No redundancy and you can never forget to add this code in a new page). So this is a good approach with any of the suggested solutions (Log4j, ThreadLocal or Hashtable)
> -----Original Message----- > From: Roland Nygren [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 5:02 PM > To: [EMAIL PROTECTED] > Subject: RE: How to keep same thread during a session > > session.setParameter("CallId", callId); > callIdListSingleton.set(Thread.currentThread().hashCode() , callId); > > and the in all other servlet / JSPs > int callId = session.getParameter("CallId"); > callIdListSingleton.set(Thread.currentThread().hashCode() , callId); > > and then in the java code (i.e. log-method) > int callId = > callIdListSingleton.get(Thread.currentThread().hashCode()); > > Serlvet filter is new to me. I assume it would reduce the > repeated code in the servlets above? > ThreadLocal is something I have'nt looked into but it looks > like I have a good reason now. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
