This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi All, here is my issue.In my application i am checking Duplicate user in action class .i want if the user is already present then we should got message.i.e. "this user is already present.do you want to creat the same" with two button OK and CANCEL.if user click on ok it will save with that name other wise not. from my acction class i am getting the message but that is error message not like what i want. please help me to solve this issue.
Originally posted by Ramanuj Kumar: from my acction class i am getting the message but that is error message not like what i want. please help me to solve this issue.
Well I don't get much what you mean here but, if you want to display a custom message instead of the default message from action class, then, you can put the same on your message resource bundle file and show that message on the jsp.
Pl. specify more for further clarifications.
Joined: Feb 22, 2008
hi Anubhav; Yes I am setting error message in message resource and also got that message.But i want to show that message via confirm dialog of java script with 2 buttons OK and Cancel. is it possible to do like that ???
This is not a trivial thing to do in a web application. The problem is that the check for a duplicate user needs to be done on the server side and in a typical submission cycle by the time the server sees the request it is too late to popup a message box. If you really want a browser popup window, then you might want to make an Ajax call to run the check. That way you could popup the message before the page is submitted. Another option is to take the user to another page if a duplicate user is found. From this page the user could click "Yes" to save the record or "No" to return to the previous page.