This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlet produce prompt box ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Servlet produce prompt box ? " Watch "Servlet produce prompt box ? " New topic
Author

Servlet produce prompt box ?

Joe Brigs
Ranch Hand

Joined: Jun 06, 2011
Posts: 59

Not sure if this is a Servlet or a JSP question. I have a Data Entry Screen ( JSP) , User enters Account Number and other info. Submits form and I do Javascript validation. If all the JS validation is good. I pass data to Servlet which then forwards data to a Database class to do some validation. The 1st thing it checks - does Account already exist, if not it then checks all the rows in the database to see if the Account Number exists in a SUB-Account column. Here's my question .... If the Account Number being entered already exists in the SUB-Account column, the users want to be prompted ( alert box ) with the option to continue (add record to DB ) or cancel ( not add record to DB). Also in this box they want to know what Account Number that has the SUB Account thats currently being entered as Lead Account. How do I create an alert box ? Do I create another JSP page or ? I'm new to Servlets and JSP's so hopefully this isn't to complicated. Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

In that case, the response you send back to the browser should contain the JavaScript on the page to create and show the prompt box.

Remember, everything happens through the request/response cycle.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Servlet produce prompt box ?
 
Similar Threads
Checking the accountname is exist in database or not
Questions regarding locking
Retaining DB values as well as Dynamically generated Values.. Help Needed !
JSF 2.0 - replacing JS Alert Box with what?
Locking strategy URLyBird 1.1.1 with ReentrantLock