Generate ActionMessage object without referring to the resource file

2005-09-09 Thread Deepesh Nandal
Hi There,
  I need to generate an ActionMessage object without referring to the resource 
file, as the message is received from a different server on the fly.
 Following code works fine if i have Login.invalid defined in the resource 
property file.

ActionMessage message = new ActionMessage(Login.invalid);


But I need it so that the message could be a Java String object ,the Following 
code DOESN'T work :

String message = I am a message ;
ActionMessage message = new ActionMessage(message);

Please Help,

Many Thanks,
Deepesh.




Re: Generate ActionMessage object without referring to the resource file

2005-09-09 Thread Wendy Smoak

From: Deepesh Nandal [EMAIL PROTECTED]

 I need to generate an ActionMessage object without referring to the 
resource file, as the message is received from a different server on the 
fly.


I need it so that the message could be a Java String object ,the Following 
code DOESN'T work :


String message = I am a message ;
ActionMessage message = new ActionMessage(message);


A quick look at the Javadoc shows that the constructor that takes a String 
expects that String to be a key.  Try this one instead:


http://struts.apache.org/api/org/apache/struts/action/ActionMessage.html#ActionMessage(java.lang.String,%20boolean)

[untested]
ActionMessage message = new ActionMessage(message,false);

--
Wendy Smoak


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]