perhaps using only local variables and marking the doGet() and doPost()
functions as protected will solve it?
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Pierre-Yves Saumont
Sent: Tuesday, September 18, 2001 5:41 PM
To: [EMAIL PROTECTED]
Subject: Re: Inconsistent behaviour in Servlet output
One possible cause is that you might be using members variables. (Members
variables are shared by all threads going through your servlet.) You should
only use local variables. BTW have you check that your servlet is called
only once for each request? BTW, it would be easier to help you if you could
post the relevant code.
Pierre-Yves
-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de
Graham, Billy
Envoy� : mardi 18 septembre 2001 16:58
� : [EMAIL PROTECTED]
Objet : Re: Inconsistent behaviour in Servlet output
Hi again,
As I said earlier I am new to Servlets and am using a freebie server (for
development purposes) with a built-in Servlet-container (vqServer from
http://www.vqsoft.com ). This doesn't appear to display any console. I have
already done some of the other things you suggested and have been writing
out my controlling variables to a text file which I then examined. It was
from this text file that I discovered my variables are 'magically'
incrementing when my code definitely does not increment them by that amount.
It is nearly as though some other part of the program, or a second instance
of the Servlet, is interfering with the variable. Although I am new to
servlets (and Java in general) I have been programming for a long time so am
quite confident there is no other part of the program changing the
variables. ??? Any further ideas would be welcomed!
Best regards, Billy.
-----Original Message-----
From: Pierre-Yves Saumont [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2001 14:12
To: [EMAIL PROTECTED]
Subject: Re: Inconsistent behaviour in Servlet output
Hi,
Do you mean you are developping without access to the servlet container
console? Which servlet container do you use? If you use Tomcat or other
container that can run in standalone mode, you should probably install a
local copy for testing purpose. If you really can't, you can log debug info
and read it from your server. You can do this several ways. You can write
the debug info to disk and read it through another servlet, or you can use a
database, or you can use a static counter to count requests, or you can
simply add a member variable to your servlet. This is the easiest way,
although not very reliable, but it should at least give you some info.
Just add an int member to your servlet, increment it in the doGet method an
display it in the response. This way, you will know if the servlet is called
more than once (unless the servlet is unloaded and reloaded by the
container).
Pierre-Yves
-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de
Graham, Billy
Envoy� : mardi 18 septembre 2001 14:24
� : [EMAIL PROTECTED]
Objet : Re: Inconsistent behaviour in Servlet output
Hi Pierre-Yves,
Excuse my ignorance, but how do you get a console window displayed when a
servlet is running? I can do this OK with a java application but have never
seen a console appear during servlet execution?
Thanks, Billy.
-----Original Message-----
From: Pierre-Yves Saumont [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2001 10:37
To: [EMAIL PROTECTED]
Subject: Re: Inconsistent behaviour in Servlet output
Hi, Billy,
Did you check how many times the request is issued ? You can check this by
including a System.out.println("....") in you servlet and look at the
console to see how many times it is displayed for each "single" request. (I
don't know about Adobe SVG add-in, but this was the source of a bug with the
Adobe Acrobat plug-in).
Pierre-Yves
-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de
Graham, Billy
Envoy� : mardi 18 septembre 2001 09:36
� : [EMAIL PROTECTED]
Objet : Inconsistent behaviour in Servlet output
Hi to all.
I have a problem that I've been trying to overcome for a number of days now
and cannot see what is going wrong - hopefully someone will be able to point
me in the right direction. I am still fairly new to servlets so please
excuse me if the problem I pose is basic.
I have written a servlet that queries a database, extracts the data and
writes the data to the client (MSIE5.5) as SVG (XML) where it is displayed
as graphs by the Adobe SVG add-in (V2). All this works perfectly - most of
the time! Sometimes the graphs do not display in the correct position,
totally messing up the display. To source the 'bug' I have written out
various variables to a file on the server and examined them afterwards.
Basically some of the variables I am using as counters, to place the graphs
on-screen, occasionally change value 'for no reason at all' that I can
determine, certainly I am not changing them directly in my code.
I use doGet() to send my data request to the servlet from a web page. This
usually works fine, but if I edit the URL data directly, in the client
browser address line, to select different data then the resultant graphs are
usually not displayed correctly (i.e. the file shows the counter variables
have incremented incorrectly). If however I then click on 'REFRESH' on the
client browser (with the manually edited URL still in force) the new graphs
then display OK on the second time of asking. This behaviour seems to be
consistent. The only clue to what is going on is that the web server
displays two messages during the erroneous manual editing phase but only one
message during the 'good' REFRESH phase. I have displayed the messages below
in full but I have to admit I only have basic knowledge in this area so am
not sure what they mean. Can anyone please point me in the right
direction???
Manual Editing messages (2 off) :
[1]:
Tue, 18 Sep 2001 08:02:01 GMT+01 localhost/127.0.0.1 -
80: GET
/servlet/QSee4?Dep=BG&Ana=PLUTO&Controls=VER1&Tests=Na&Tests=CL&Tests=Ca
HTTP/1.1
200 OK 4080
[2]:
Tue, 18 Sep 2001 08:02:02 GMT+01 localhost/127.0.0.1 -
80: GET
/servlet/QSee4?Dep=BG&Ana=PLUTO&Controls=VER1&Tests=Na&Tests=CL&Tests=Ca
HTTP/1.1
200 OK 68138
REFRESH message (1 off) :
[1]:
Tue, 18 Sep 2001 08:03:13 GMT+01 localhost/127.0.0.1 -
80: GET
/servlet/QSee4?Dep=BG&Ana=PLUTO&Controls=VER1&Tests=Na&Tests=CL&Tests=Ca
HTTP/1.1
200 OK 4080
Many thanks in anticipation.
Regards, Billy Graham.
___________________________________________________________________________
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
___________________________________________________________________________
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
___________________________________________________________________________
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
___________________________________________________________________________
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