You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Johan Compagner <jc...@j-com.nl> on 2000/12/15 23:17:05 UTC
What i would like to do....
Hi,
I use many constants for storing objects in the different scopes.
But inside a jsp page i can't use those like this:
<logic:notPresent name="com.topicus.thema.Constants.USER_KEY" scope="session">
but i must type the string behind the constant:
<logic:notPresent name="user" scope="session">
Is there a property like name_as_constant or something?
johan compagner
Re: What i would like to do....
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Matthias Kerkhoff wrote:
> > Sorry, RTE is the shorthand for request-time attribute expressions or
> > just request-time expressions. The JSP Spec. explains them as follows:
>
> > [... doesnt really explain RTEs ... ]
>
> My intention was to paste the following text from the spec.
>
> rtexprvalue
> Defines if the nesting attribute can have scriptlet expressions as a value,
> i.e the value of the attribute may be dynamically calculated at request
> time, as opposed to a static value determined at translation time.
>
As an additional note on this topic, I just modified the remaining Struts 1.0
tags to accept runtime expression values for *all* attributes. There was some
code in 0.5 that depended on this not being true, but it's all been adapted.
>
> --
> Matthias (mailto:make@BESToffers.de)
Craig
Re[3]: What i would like to do....
Posted by Matthias Kerkhoff <ma...@BESToffers.de>.
> Sorry, RTE is the shorthand for request-time attribute expressions or
> just request-time expressions. The JSP Spec. explains them as follows:
> [... doesnt really explain RTEs ... ]
My intention was to paste the following text from the spec.
rtexprvalue
Defines if the nesting attribute can have scriptlet expressions as a value,
i.e the value of the attribute may be dynamically calculated at request
time, as opposed to a static value determined at translation time.
--
Matthias (mailto:make@BESToffers.de)
Re[2]: What i would like to do....
Posted by Matthias Kerkhoff <ma...@BESToffers.de>.
Hi Johan,
>> for such cases. Of course, this only works if the tag-property has been
>> declared as an RTE.
> sorry that i don't know al the terms like RTE.
> But what is this? And are most of the property's in struts RTE?
Sorry, RTE is the shorthand for request-time attribute expressions or
just request-time expressions. The JSP Spec. explains them as follows:
Request-time attribute expressions are of the form <%= expression %>. Although this
syntax is consistent with the syntax used elsewhere in a JSP page, it is not a legal XML
syntax. The XML mapping for these expressions is into values of the form %= expression
%, where the JSP specification quoting convention has been converted to the XML quoting
convention.
Basically, it means, tag-attributes that are marked as RTEs allow you to
use the <%= %> syntax to dynamically build the attribute value. In all
other cases, tag attributes have to be static values, that are evaluated
once (at translation time).
Wether a tag attribute is an RTE or not is defined in the TLD (tag library
descriptor). For struts, the TLDs are generated on the fly during the build
process. The source for these generated tld's are struts-*.xml files, located
in the .../src/doc directory of the struts distribution.
To find out, if a tag's attribute is an an RTE, just look at the line
containing <rtexprvalue> element for the attribute in question.
It will say either true (RTE) or false (TTE).
My build is a bit outdated, so I can't answer your question, regarding the
RTE-ness of struts attributes. But usually, if you have found an attribute,
thats not declared as RTE and a good reason why it should be, you should post
a message to the list and someone with write access to the source will
change it.
--
Matthias (mailto:make@BESToffers.de)
Re: What i would like to do....
Posted by Johan Compagner <jc...@j-com.nl>.
> for such cases. Of course, this only works if the tag-property has been
> declared as an RTE.
sorry that i don't know al the terms like RTE.
But what is this? And are most of the property's in struts RTE?
johan
Re: What i would like to do....
Posted by Matthias Kerkhoff <ma...@BESToffers.de>.
Hi Johan,
> <logic:notPresent name="com.topicus.thema.Constants.USER_KEY" scope="session">
I usually use
<logic:notPresent name="<%= com.topicus.thema.Constants.USER_KEY %>" scope="session">
for such cases. Of course, this only works if the tag-property has been
declared as an RTE.
> Is there a property like name_as_constant or something?
No.
--
Matthias (mailto:make@BESToffers.de)