Dear All,

We want to store CSS as message resources as we white label our site for
different partners. The white labelling takes place through our own
content management system, which we have interfaced struts to via our
own implementation of the MessageResourcesFactory.

Everything works fine, apart from style sheets. Looking through the
struts source for 1.2.7 it's because Struts strips any message content
of single characters before performing an argument replacement using the
java.text.MessageFormat class.

Now this is fine for when you want to do something of the form :

<bean:message key="some.key" arg0="hello"/>

but we don't.

Our CSS has the usual stuff, including sequences such as "{blah; blah
blah}", and this causes npe's in the text replacement as it's seen as a
token. If we try and escape it as per the javadocs with '{' blah '}'
it's stripped by Struts !

Looking at the code for bean:message (MessageTag.java) reveals that it
invokes the underlying TagUtils method that accepts an array of Object[]
as text replacement params even when they are not set ! So:

1. Isn't this a bug ? Surely, of arg0=arg1=arg2=null then the TagUtils
call that doesn't accept text replacement args & so doesn't strip the
message should be called ?
2. Is there any way, short of writing our own version, to get the
message bypassing the whole text replacement / stripping stuff ? If not,
we can't have any occurrences of "{<some text>}" anywhere in our messages ?
3. Just out of interest, why is the message source stripped anyway ?

Thanks,

Jon.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to