Velocity Reviews

Velocity Reviews (
-   Java (
-   -   Apache-Jserv: Servlet doubles info (

Loek Raemakers 10-21-2004 09:10 AM

Apache-Jserv: Servlet doubles info
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;

case 1:

// 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>";
if (i + 1 == num)// = max aantal per groep !
lijstregel = "<BR><BR><B><FONT
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.

All times are GMT. The time now is 09:30 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.