Hi, I know, but I want to have a similar behavior like "global variables" to access Request/Response-Object without to pass them as parameter to each method I need to access them.
Does this mailing support attachments ? Else my problem could be a bit confusing. greets Jan Zimmek ----- Original Message ----- From: "David Graham" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, August 18, 2003 11:42 PM Subject: Re: [OT] Question about Servlets & Threads > --- Jan Zimmek <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I know this is a struts-related list, but it would be great if some of > > the servlet-experts could answer my question anyway. > > > > First of all I have to say "I love JAVA" and will never go back to PHP > > (i have started with). > > > > But I like the global variables in PHP like ($_GET, $_POST, $_SERVER, > > ....) so i tried to simulate this. > > > > I am doing this by merging a servlets doGet / doPost method to a single > > method called "process". > > > > This method will create foreach incoming request a new Thread-Subclass > > which is responsible for processing this request (HttpServletRequest and > > HttpServletResponse will be referenced by according attributes in the > > thread-subclass). After processing this thread will be released. > > You don't need to code threads in a Servlet because the container is > already multi-threaded. Multiple threads will be running through your > Servlet at once. > > David > > > > > The thread will invoke something similar like a Action in Struts. > > > > BUT NOW TO MY PROBLEM ;-) > > > > I have a class called "Globals" which uses the "Thread.currentThread()" > > method to obtain the thread responsible for this request. As described > > above the Request/Response-Object of this request are referenced by the > > thread and are accessible by "getter"-method. > > > > Can I know be sure that the Request/Response-Object is always the it > > should be or can there be any inconsistency ? > > > > I have attached some source-files and would be very great if some of you > > could explain me if anything would work or if I am running in trap :-? > > > > greetz > > Jan Zimmek> > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]