Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2-M1
-
Component/s: None
-
Labels:None
Description
When invoking a tag as a method with a body, the body object passed to the tag is no longer the original Closure, it has been wrapped up - and when you invoke it it immediately writes to out, and returns and empty string. So it appears that:
out << body()
is doing the right thing but you soon see the problem if you do this:
def b = body()
out << "This comes first" << b
You will see the body comes out before the string.
Here's a concrete Taglib example from Graeme demonstrating this:
class TestTagLib {
def test2 = { attrs, body ->
out << "four" << test(foo:"bar", "foo") << "five"
}
def test = { attrs, body ->
def value = body()
out << "one" << value << "two"
}
}
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Fixed