You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2001/06/02 07:11:44 UTC

RE: Using tags from Java code


On Thu, 24 May 2001, Young, Wayne wrote:

> We put reusable functionality in utility classes and call those from the
> custom tag.
> 

In fact, many of the Struts tags themselves are designed like
this.  For example, nearly every tag that deals with beans and properties
ends up calling methods on BeanUtils and PropertyUtils.

The challenge with John's original question (can we create a "tag runner"
outside of a JSP page) is actually pretty important, when you consider the
issue of how to unit test JSP custom tags.  The hard part is that there is
a very large amount of "context" that you have to set up to make a custom
tag run -- you end up almost having to provide the runtime environment of
a servlet container to fully test these things :-(

> Wayne
> wyoung@metasolv.com

Craig McClanahan