jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes ActionErrors and error message from legacy system help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionErrors and error message from legacy system help needed" Watch "ActionErrors and error message from legacy system help needed" New topic
Author

ActionErrors and error message from legacy system help needed

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 130
Hi,
In my application error messages are sent by a
legacy
application, and dont come from properties file, so
how can i put these messages in my ActionErrors
class
so i can display them on jsp,
for example how can i do this??
in my code i have
ActionErrors errors = new ActionErrors();
String message="message from legacy
application";//suppose this is the message that
comes
from legacy application
errors.add(ActionErrors.GLOBAL_ERROR,new
ActionError(message));
but i get error when i do this,
so how can i make this work


A$HI$H
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
The messages in the Application Resource file can take up to four replacement parameters. The ActionError constructor takes several signatures so that you can specifiy the key and the needed parameters. To display an arbitrary message, add a line like this to your file:
errors.dynamic = {0}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ActionErrors and error message from legacy system help needed
 
Similar Threads
html:error --- validator..
Struts: ActionMessage vs. Action Error
Getting values from properties in validate-using multiple message-resources in struts
ActionMessage
getting messages from MessageResources file