This post originated from an RSS feed registered with Java Buzz
by Simon Brown.
Original Post: TagUnit 1.0.1 available
Feed Title: Simon Brown's weblog
Feed URL: http://www.simongbrown.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on Java, software development and technology.
TagUnit 1.0.1 has been uploaded to the SourceForge file release system. It's a minor update that fixes a problem where using the expectedResult and actualResult tags with empty bodies can result in reuse of previous body content. You can get it here.
I've only noticed this behaviour on Tomcat 4.1.x and it's caused by the way that the JSP is translated into a Servlet. I'm not sure whether this is part of the spec, but when a tag handler instance is reused, its body content (if it's a BodyTag) does not get set to null if the body content is empty. What this means is that calling getBodyContent() gives you back whatever content was used in the previous invocation with that tag handler. As a fix, I simply call clearBody() when I'm finished accessing it.