Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

JSP Page Loop & Parameter Problems

Thread view: 
KieranM - 07 Mar 2006 14:14 GMT
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
Larry - 07 Mar 2006 20:27 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.