Hi,
Why is the serialNumber field static?

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Denise Mangano [mailto:[EMAIL PROTECTED]
>Sent: Thursday, March 25, 2004 12:14 PM
>To: Tomcat Users List
>Subject: RE: Possible thread "crossing"
>
>Ralph,
>
>In the bean there is an instance variable:
>       private static String serialNumber="";
>
>And it is set using the regular set method:
>       public void setserialNumber(String sn) { serialNumber = sn; }
>
>The purpose of the serial number is to identify which client the
>information being processed is for.  Correct me if I am wrong but I
have
>the scope of the bean set to session.  That means that that when user A
>accesses my first JSP page it starts a session and the variables apply
>to that session until the user ends it.  If user B comes to the site
>they get their own session started.  Is that correct?  If so then if
>User A is in the middle of the session how could it be possible that
>they are requested the form more than once in their session?
>
>Dave, yes I am using mod_ssl 2.8.16.
>
>Thanks.
>
>
>Denise Mangano
>Complus Data Innovations, Inc.
>914-747-1200
>
>-----Original Message-----
>From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
>Sent: Thursday, March 25, 2004 11:43 AM
>To: Tomcat Users List
>Subject: RE: Possible thread "crossing"
>
>So far so good, but how is the serial number stored in the validator
>bean ?
>
>If the id is stored in an instance variable it may be possible that 2
>concurrent request in the same session to any form that uses this bean
>might cause problems.
>(It is possible to change the value between jsp:setProperty and
>isValid())
>
>What exactly is the purpose of the serial id ?
>
>
>> -----Original Message-----
>> From: Denise Mangano [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, March 25, 2004 5:05 PM
>> To: Tomcat Users List
>> Subject: RE: Possible thread "crossing"
>>
>> <%@ page import="com.beans.clients.Validator" %> <jsp:useBean
>> id="formValidator" class="com.beans.clients.Validator"
>> scope="session"/>
>> <% formValidator.reset(); %>
>> <jsp:setProperty name="formValidator" property="*"/>
>>
>> <% if (formValidator.isValid()) {   %>
>>
>> If the form data is not valid it calls Retry.jsp which I have tried
>> two ways:
>> 1) <input type="hidden" name="serialNumber"
>> value="<%=formValidator.getSerialNumber()%>">
>> 2) <input type="hidden" name="serialNumber" value="123456789">
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to