You're right that the session values are stored in the server, and I think a
bean is a very convenient way to store these values, but I suggest that you
do the math to determine whether this is consuming two much memory:

num_bytes = [75 * (avg_field_name_size) * 2] + [75 * (avg_value_size) * 2] *
expected_number_of_concurrent_users;

(The *2 is because Java characters are 2 byte Unicode characters)

The numbers can quickly add up. Then of course you can start looking for
ways to reduce this cost.  For instance, the field names are always the
same, so do you have to store them in every bean or can they be static class
data?  Can you number the fields rather than using a label and then use the
number for the HTML element's ID value?  If the form history isn't
frequently used, is it more efficient to persist the form values into a
temporary file that's associated with the session?

My .02,
David


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Paul Medcraft
> Sent: Thursday, November 04, 1999 4:53 AM
> To: [EMAIL PROTECTED]
> Subject: Session values question
>
>
> I need to store form field values from a fairly large form (75 fields) so
> that later forms can be prepopulated. I have written a Bean that
> uses a two
> dimensional array of Strings to hold field names and values.
>
> This works well, but I am unsure how it will affect server
> performance when
> accessed by a lot of users concurrently. Am I right in thinking
> that session
> values are stored in the Server's memory?
>
> Also, I know I could simply have written the field names & values directly
> to the Session Object rather than writing the Bean. Is there much
> difference
> apart from adding an unnecessary component? (I went for the Bean
> as I hadn't
> used one before and wante to try it out.)
>
> Thanks,
>
> Paul
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to