|
 |
pro_java_server thread: Re: Concerning Smart Servlet Pattern
Message #1 by Chanoch Wiggers <ChanochW@w...> on Thu, 16 Aug 2001 12:46:27 +0100
|
|
you would probably need to pass it (the session object) or better still the
relevant object to the relevant class. If you think about it, the servlet is
responsible for monitoring and maintaining user level information so it
should be the servlets job to access the session information and pass it to
the relevant class in a form the class can understand. Making the class
dependant on the way session information is held on the server is a bad idea
as it doesnt allow you to change the way you store sessions or session
ifnormation easily.
chanoch
-----Original Message-----
From: Guy Walker [mailto:guy@t...]
Sent: 22 July 2001 20:25
To: Java Server
Subject: [pro_java_server] Re: Concerning Smart Servlet Pattern
I am finding the same problem with the smart servlet example. Did you find
any other information or resources for this pattern?
Guy
> 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
|
|
 |