Apache-Jserv: Servlet doubles info

L

Loek Raemakers

Dear java-users,

I made a program consisting out of 1 Applet and 2 Servlets.
The program runs on Apache-Jserv ( Windows '98).
The Applet sends info to the Servlet1, this Servlet puts the into in a .txt
file. Servlet2 retrieves the info and presents it in a HTML-page, as a list .
There are 10 different short-lists. The writing to the file is no problem.
The retrieving of a choosen list is no problem. So far so fine.
But when a user wants to put his name on a chosen list and directy controls if
his name is on that list, the user's name is appended twice.!
The rerieving-servlet; reads the file at the get-method, analyses the string (
StringTokenizer), puts all the info ( long list) in a Vector, composes the
desired short list, and makes HTML out of it. This is presented to the user.
Some code:

// For reading the file I use a BufferedReader.

Vector tepresenterenlijst = new Vector();
Vector dramaV = new Vector();

// The calling;

switch(lijstno)
{
case 1:
lijstMakker(dramaV);
naamGever("dramaV");
groepsGrootte(16);
break;
……

// The making of the short-list ;

protected void lijstMakker(Vector x)
{
tepresenterenlijst.removeAllElements(); // we beginnen met een lege
lijst !
int i = 0;
int num = groepsGrootte(max);
for ( i = 0; i < x.size(); i++) // geen min 1 !
{
String regel = x.elementAt(i).toString();
String lijstregel = "<LI>" + regel + "</LI>";
tepresenterenlijst.addElement(lijstregel);
if (i + 1 == num)// = max aantal per groep !
{
lijstregel = "<BR><BR><B><FONT
COLOR=\"red\">Wachtlijst:</FONT></B>";
tepresenterenlijst.addElement(lijstregel);
}
else
{
lijstregel = lijstregel;
}
}

}

How to overcome the doubling in direct presentation of the info?
Is it the number of threads of Apache?
Is it the use of a Vector?
Is it a stream (not) flushed() or closed()?
Is it the Servlet - session itself that causes the problem?
Please, give me a pointer in the good direction.
Loek eR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top