Hi!
The bean:define tag simply exposes a bean as a scripting variable by adding
it to the page context:
// from DefineTag.java
pageContext.setAttribute(id, value, inScope);
Now one can access the bean by
<bean:define id="title" value="test"/>
Value of title: <%= title %>
I did the same within a custom tag I wrote but I cannot directly access the
bean as a scripting variable:
<x:mytag id="title" key="test"> // the tag retrieves some key and stores it
in the bean "title"
Value of title: <%= title %>
causes an "Variable title not defined" exception,
but
Value of title: <%= pageContext.findAttribute("title").toString() %>
works fine.
Before anyone asks: I have to use scriptlets, because I want to nest the
output within another struts tag.
Thanks for your help,
Markus Wittwer