struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <...@Germuska.com>
Subject RE: ActionMessage replacement "keys" ?
Date Tue, 21 Dec 2004 18:33:46 GMT
>  > but i also see your point.  just having one unique message for each
>>  unique situation is simple and does the job.  the only negative thing
>>  is that it takes up more memory when the message bundle is cached in
>>  application scope since there will be a lot of duplication in the
>>  bundle.
>>
>>  i was hoping i could clean things up.  for example, instead of this:
>>
>>  error.invalid.first.name=Invalid first name
>>  error.invalid.last.name=Invalid last name
>>  error.invalid.middle.name=Invalid middle name
>>  error.invalid.address=Invalid address
>>  error.invalid.zip.code=Invalid zip code
>>
>>  i could get this:
>>
>>  error.generic.invalid=Invalid {0}
>
>In this particular case, you're probabaly okay.  I was thinking you 
>meant something more complicated, such as an entire paragraph of 
>boilerplate etc.  Complex error mesaages though....

Also, for this specific case, it so happens that the 
commons-validator library DOES ultimately support looking up 
replacement values by key and using them in messages also looked up 
by key.  So, if the most common use case for this need is in 
validation error handling, anyone who uses Struts validator libraries 
is getting the behavior you seek and not feeling its lack in Struts.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Mime
View raw message