Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prompt user

Status
Not open for further replies.

zeero

Programmer
Aug 4, 2004
60
US
Hi all, I have a form in jsp that adds info into a database (insert into..) However, as of now I have it set with try catch blocks to capture and display errors on another page instead of getting the apache error pages. I want it to so instead of getting the duplicate key error message to prompt the user if he wishes to update instead. So in that particular catch block would I redirect to a new page to allow an update? If so, how?
I'm sure there are a few ways of doing this, but any suggestions would be appreciated. Hope this makes sense :) Thanks.
 
In a situation such as this, I would probably query the database first and determine if a user prompt is necessary, then write the following two HTML forms in if/else blocks:

(1) if(promptNecessary){prompt user, set hidden form element with response, then submit to the next page, using the user's response to determine how to draw it;}

and

(2) else{immediately redirects to main page if user prompt is not necessary.}

'hope that's useful.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top