You're right. I should have said that you can use any number of parameters
up to four.

-----Original Message-----
From: Brendan Richards [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 18, 2004 9:52 AM
To: Struts Users Mailing List
Subject: RE: Dynamic Messages

>>You could have as many parameters as you want

I thought you could only use up to four (arg0 to arg3).

The dtd for validaton.xml only contains these elements.

Or can you use more when creating a message in code rather than through
validation.xml ?



-----Original Message-----
From: Wiebe de Jong [mailto:[EMAIL PROTECTED] 
Sent: 18 March 2004 17:37
To: 'Struts Users Mailing List'
Subject: RE: Dynamic Messages

Messages from your resource file can have parameters.

Resource file:
user.added={0} successfully added

Action:
errors.add(ActionErrors.GLOBAL_ERROR, 
  new ActionError("user.added", bean.name));

messages.add(ActionMessages.GLOBAL_MESSAGE, 
  new ActionMessage("user.added", bean.name));

You could have as many parameters as you want. For example:
detail.line={0} of {1} was added on {2}

-----Original Message-----
From: Ciaran Hanley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 18, 2004 9:14 AM
To: Struts User Mailing List
Subject: Dynamic Messages

Hey,

 

Can ActionMessages/ActionErrors be created dynamically or do they always
need to read from a resource file.

 

I would like a more meaningful message shown when something is added to
the
DB, like instead of "Client successfully added" I would like "Joe Bloggs
details have been added". Can this be done using these classes?

 

Thanks

 



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


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


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

Reply via email to