aspose file tools*
The moose likes Struts and the fly likes action class message issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "action class message issue" Watch "action class message issue" New topic
Author

action class message issue

Ramanuj Kumar
Greenhorn

Joined: Feb 22, 2008
Posts: 18
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.


With Regards,<br />Rama
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

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

Joined: Feb 22, 2008
Posts: 18
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

Joined: May 18, 2007
Posts: 341

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.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: action class message issue