Hello
This is a 'typical' multithreading issue.
Synchronizing may be a solution, but it would get worst perfomance.
Another way to achieve it without synchronize the method is as follows:
Do not use atributes in the methods.
Basically, each servlet request spawn a new thread, and each thread is able to
change the values of the atributes, so the result is unpredictable, since you
don't have control of the order of execution of each thread.
On the other hand, the parameters are local variables of the method, wihch
avoid that problem.
Just pass as parameters as necesary (including the OutputStream), and call them
in the
standard way :
sendFrameset(param1, param2, ...)
sendFrameF1(param1, param2, ...) ...
It could be a pain if there are a lot of params, but works for most cases.
Hope it helps
Michael Stacey wrote:
> <snip>
> I'm thinking that I have to synchronize the member functions
> responsible for sending the HTML to the client, but can't
> seem to find *what* to synchronize them on. A static servlet
> member value? This?
>
> Any help would be appreciated. HELP STAMP OUT STM!
>
> Michael
> ---------------------------------
>
> sample servlet code:
>
> public void doGet(HttpServletRequest req, HttpServletResponse res) {
> String action = _req.getParameter("a");
>
> if (action == null) {
> // send HTML code for frameset
> sendFrameset();
> }
> else if ( action.equals("f1") ) {
> // send HTML code to populate frame 1
> sendFrameF1();
> }
> else if ( action.equals("f2") ) {
> // send HTML code to populate frame 2
> sendFrameF2();
> }
>
> }
--
------------------------------------------------
Manuel Hurtado Sanchez
Telefonica Servicios Avanzados de Informacion
Dept.Ingenieria de Servicios
Phone: +34 917548650
Fax: +34 917548692
Julian Camarillo,6
28037 Madrid, Spain.
------------------------------------------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html