>
the "attribute" in the page context.

<forum:hasContent content="<c:out value="${attribute}"
/>"></forum:hasContent>

i know that has a way to do like this:

<bean:define id="new_id" name="attribute"/>
<forum:hasContent content="<=new_id.toString()>"></forum:hasContent>

but there is another way to do it?
<

You should be able to use the type attribute to avoid having to call
toString() in your forum tag:

<bean:define id="new_id" name="attribute" type="java.lang.String"/>
<forum:hasContent content="<=new_id%>"></forum:hasContent>

Or, if you are dead set against using multiple tags, you could throw it
all into one RT expression, as in: <forum:hasContent
content="<%=(String)pageContext.findAttribute(\"attribute\")%>"></forum:
hasContent>

However, not only does that look really ugly, it is also very vulnerable
to typographical errors -- I might have made one just now. =)

A better solution, if you are writing the forum taglib yourself, might
be to modify or subclass your hasContent tag to accept expression
language in attributes, leaving you with the much cleaner:

<forum:hasContent content="${attribute}"></forum:hasContent>

If that is the case, take a look at how the strutsel package handles
expressions.  The org.apache.strutsel.taglibs.utils.EvalHelper class has
convenience methods that should make it fairly easy to modify your own
tags to use expression language.




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

Reply via email to