• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

action class message issue

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ramanuj Kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ???
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ramanuj,

Pl. try to keep all data for a query in a single post and not in multiple posts. Like Post for action message and Post for action error
This helps to solve your problem quickly.

Well, I have replied to both your posts and hope you have got your answer.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

- Brent
 
reply
    Bookmark Topic Watch Topic
  • New Topic