You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Priit Pihlak <vi...@hot.ee> on 2002/08/06 01:38:18 UTC

bean_message is problematic

that Trend SMEX Content Filter is driving me nuts.. perfectly normal mail
but it "detected sensitive data" FXXX  OXX

So i'll keep it short because i don'f know which normal words it doesn't
like

I nees (one guy just asked for same thing) but his has nothing to do with
tiles
<display:setProperty name="text" value="<%=var %>" />
so that var is message from Resource file <bean:message key="...">
it should have id="var" !! developers!!

Priit



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bean_message is problematic

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 6 Aug 2002, Priit Pihlak wrote:

> I nees (one guy just asked for same thing) but his has nothing to do with
> tiles
> <display:setProperty name="text" value="<%=var %>" />
> so that var is message from Resource file <bean:message key="...">
> it should have id="var" !! developers!!
>

I think you might want to calm down and take a deep breath :-).

The key problem is that you can't nest one custom tag inside another,
because that is invalid XML syntax.  So the following does not work:

  <display:setProperty name="text"
   value="<bean:message key='...'/>"/>

so we need to define a runtime expression equivalent.  Fortunately, such a
thing exists.

Let's assume that you are running Struts 1.1, and want the default
MessageResources instance for your sub-application module.  Struts puts a
reference to this in your request attributes, under the key
"org.apache.struts.action.MESSAGE".  So, you can say something like this
(assuming you have imported the org.apache.struts.util.MessageResources
class):

  <display:setProperty name="text"
   value='<%= ((MessageResources) reqest.getAttribute("org.apache.struts.action.MESSAGE"))
                                        .getMessage("key.to.look.up") %>'/>

In Struts 1.0, it's an application-scope attribute instead, so just change
"request" to "application".

> Priit
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>