JSP Page Loop & Parameter Problems

Discussion in 'Java' started by KieranM, Mar 7, 2006.

  1. KieranM

    KieranM Guest


    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

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

    Thanks in advance
    KieranM, Mar 7, 2006
    1. Advertisements

  2. Larry

    Larry Guest

    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

    Larry, Mar 7, 2006
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quick Function

    jsp send parameter to next page

    Quick Function, Jul 15, 2004, in forum: Java
    Tor Iver Wilhelmsen
    Jul 15, 2004
  2. Ranginald
    May 1, 2006
  3. Replies:
  4. Replies:
    Bob Barrows [MVP]
    Jul 19, 2006
  5. Isaac Won
    Ulrich Eckhardt
    Mar 4, 2013

Share This Page