Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: Bean and Servlet

Mohammed Zabin

2007-07-27

Replies:

Ok, in the first page, which use a tag, I generate 10 random numbers. and
generate a SQL statement containing this numbers like the following:
SELECT * FROM table WHERE id in ( 2, 3, 5, 10, .... etc). I use a string to
hold the " in " statement and bound it to the whole query string.

After submitting the page, I need to check the validety of the answers, for
the same questions. So, I store the inStr in a session and read it in the
second page.

Regarding concurrency issue, I think that I don't need to synchronize random
number generation. Because I don't have a problem for multiple requests to
have the same set of questions.


On 7/27/07, Pid <p@(protected):
>
> Caldarale, Charles R wrote:
> >> From: Mohammed Zabin [mailto:jotnarta@(protected)]
> >> Subject: Re: Bean and Servlet
> >>
> >> My Problem is that, I want to pass these numbers, Questions
> >> IDs, from the first page, which i have made it as a tag class,
> >> to Results page, which was made as servlet.
> >
> > Rather than hanging onto the ID within Tomcat, why not store it on the
> > generated web page (as a hidden field) and have some script on that page
> > include it with the next request from the client? That way you avoid
> > all synchronization issues that can occur with simultaneous requests.
>
> It sounds like a simple form submit with (a) hidden field(s).
>
> Why do all of the rest of the ids need to be submitted as well, if
> you're only checking for the single correct answer?
>
> p
>
>
> >> That was my problem my buddy, by the way, when i used
> >> session, it worked fine. and you stated that this will
> >> not work
> >
> > I didn't say it wouldn't work, I said you had to be careful and take
> > concurrency into account, which your code snippets did not.
> >
> > - Chuck
> >
> >
> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> > MATERIAL and is thus for use only by the intended recipient. If you
> > received this in error, please contact the sender and delete the e-mail
> > and its attachments from all computers.
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@(protected)
> > To unsubscribe, e-mail: users-unsubscribe@(protected)
> > For additional commands, e-mail: users-help@(protected)
> >
> >
>
>
>
©2008 junlu.com - Jax Systems, LLC, U.S.A.