You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Biesbrock, Kevin" <Bi...@aoins.com> on 2011/04/14 18:13:42 UTC
Reading .properties From Top-Level Package
I have the following business requirement:
-Include "common contact information" (i.e., the director and
her staff) in a view that will also be used at the bottom of an email
sent out by the same system
We would like to keep the formatting of said contact information
consistent wherever it is used.
Before the email requirement, the information was stored in a jsp and
included where necessary using tiles. The complexity of compiling a jsp
and returning the resulting html is simply an inadequate solution. I
polled some brains around here but nobody seemed to have a definitive
answer. One suggestion that came about was to add the html to a
.properties file at MyAction.properties and include them in that way.
This would be fine, but the information doesn't "belong" at the action
level...it's system-wide data.
1. Is storing the html in a properties file an acceptable approach?
2a. If so, how can I use either getText() or s:text to retrieve the
value from a .properties file that is not written for the specific
action (i.e., in a different, top-level package)?
2b. If not, can you help me think of a better method?
Thank you,
-Beez
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Reading .properties From Top-Level Package
Posted by "Biesbrock, Kevin" <Bi...@aoins.com>.
>I wouldn't consider storing HTML in a properties file. That sounds
messy.
Not only does it sound messy, it looks pretty fugly, too!
> I would explore using Velocity.
Thank you for the guidance, sir!
Sincerely,
Beez
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Reading .properties From Top-Level Package
Posted by Eric Lentz <Er...@sherwin.com>.
>Before the email requirement, the information was stored in a jsp and
>included where necessary using tiles. The complexity of compiling a jsp
>and returning the resulting html is simply an inadequate solution.
I would explore using Velocity. Struts will display a Velocity page or you
can shove the output into a variable that you display from a JSP - the
result of a Struts action. E-mail and Velocity are like peanut butter and
jelly.
I wouldn't consider storing HTML in a properties file. That sounds messy.