JSP Page Loop & Parameter Problems

K

KieranM

Hi

I am in serious trouble with my project and stuck on this part for
several days now.

I am using jsp (a quite new technology to me) and trying to create a
form with a pending holding action which loops back to the form.

There are 2 people needed PlayerA and PlayerB

I want PlayerA to enter their order amount through the form into the
database (1.jsp).
I want PlayerB to enter their order amount through the form into the
database (1.jsp).

If PlayerA hasn't entered their amount yet and PlayerB has then PlayerB
pauses at the next page (2.jsp).
If PlayerB hasn't entered their amount yet and PlayerA has then PlayerA
pauses at the next page (2.jsp).

This page is under a constant refreshing action.(javascript)(2.jsp)

If PlayerB has entered their amount PlayerA creates a new empty row in
the database (2.jsp).

If there is a new empty row in the database then both players return to
the first page(1.jsp).

When I return to the first page (1.jsp) because the parameters
?submit=true&amount=2 the page continues looping entering new rows and
the same values into the database until I manually stop it.

Has anyone any idea how to delete the parameters
"?submitvalue=true&amount=2" so that when I return to the original page
it does not continue looping but stops and allows users to enter new
values.


submitvalue is a hidden parameter set in the form in (1.jsp).
amount is the text input box amount (1.jsp).


Thanks in advance
 
L

Larry

Can we see some code? Might help us to figure out a little better what
you are trying to do.

Also, it's not a good practice to access the database with JSP's. Have
your JSP call a servlet (via a HTTP request; i.e. a POST or Query
String) with the information to be updated. The servlet them calls a
POJO (plain old java class) to do the database update/select. The
POJO then returns the results as an ArrayList (or other collection
type) of objects that represent your row back to the servlet. The
servlet then completes the round trip back to your JSP to display the
data.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top