struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wiebe de Jong <wieb...@shaw.ca>
Subject RE: Dynamic Messages
Date Thu, 18 Mar 2004 19:21:25 GMT
You're right. I should have said that you can use any number of parameters
up to four.

-----Original Message-----
From: Brendan Richards [mailto:brendan@designuk.com] 
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:wiebedj@shaw.ca] 
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:ciaran.hanley@sentenial.ie] 
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message