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.
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.