Wrox Home  
Search P2P Archive for: Go

  Return to Index  

servlets thread: Concerning Smart Servlet Pattern


Message #1 by "martyn morrison" <mm902@g...> on Wed, 4 Jul 2001 12:14:55
Im a newbie java server programmer starting to come up to speed on some of 
the concepts outlined in the book 'proffesional java server programming'.
Im trying to design an example website for my class mates using the smart 
servlet pattern.  I can see why this is a great design pattern,  I hust 
have a snag of a problem/question.  How do you access the users session 
object whilst inside any of the 'Transaction' classes execute method?  
Everything was going fine until i wanted to access a shopping cart whilst 
inside this method('proffesional java server programming' chapter 10).  
I'm aware that its possible to get a cart through the hashtable object, 
but alas the hashtable object is basically a clone of the hastable in the 
smart servlet ,and even if it wasn't it would be out of scope back in the 
ancestor class.  How would i get a reference to the user's session object 
from there (inside the execute method of the various Transaction classes)?
 
 
Thanks

  Return to Index