• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

MessageResource.properties - The Only Way?

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems to me kind of strange that with all the XML STRUTS uses, the MessageResource.properties file is so flat.
Is this the only way to handle this part of STRUTS? Granted that there isn't much to what this file does except specify text properties, but for a huge STRUTS App, wouldn't this file get really difficult to maintain?
Any comments? Opinions?
[ June 11, 2003: Message edited by: Gregg Bolinger ]
 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gregg,
With a huge app you can break it down into modules -- each with their own properties file. I think you're right about the flatness of it though. I really don't like that fact that long text string have to occupy one line. XML tag delimiters would sure be nice!
Darryl
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default message factory used by struts is a Property file parser (digester) that simply creates resource bundles from prop files. As a standard java props file, long lines can be broken onto multiple lines using "\". Also, if you want your bundle to be XML, simply subclass the org.apache.struts.util.MessageResourcesFactory and write your own digester. Creating your own bundle factory can be vary handy in a lot of situations like when you want to do resource string replacements.
For Example:
system.name=Longhorn
system.version=1.0
system.fullname={system.name} {system.version}
reply
    Bookmark Topic Watch Topic
  • New Topic