Hi Pete,
thank you for showing interest.
I gave the whole situation a brief thought and came to the conclusion that a generic
approach that transparently escapes rich text tokens in s:formattedText would be hard to
implement, because the method would have to differentiate somehow between formatting rich
text tokens and tokens that are simply in the text as characters, so I'm using a
pretty simple, but working, approach right now.
I'm having a Seam managed Java Bean called "ste" (short for seam text
escaper), which offers a method "esc(String s)" that escapes the rich text
tokens using a Stringtokenizer.
So in the message bundle I can escape certain properties, that could contain rich text
tokens which needs to be escaped like that:
| newGroupCreated.text=The new group '*#{ste.esc(group.name)}
(#{ste.esc(group.nameShort)})*' was created successfully.
|
Now 'newGroupCreatet.text' can be used in <s:formattedText /> even if
'group.name' contains characters like underscore or slash without breaking the
generated HTML.
If anyone is interested, I can post the code as well, but it's nothing spectacular.
Best regards,
Kurt
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107009#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...