File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes - The Only Way? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " - The Only Way?" Watch " - The Only Way?" New topic
Author - The Only Way?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

It seems to me kind of strange that with all the XML STRUTS uses, the 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 ]

GenRocket - Experts at Building Test Data
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
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!
Josh Landin

Joined: Jun 09, 2003
Posts: 10
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.fullname={} {system.version}
I agree. Here's the link:
subject: - The Only Way?
It's not a secret anymore!