6. Portal Framework
(Opens New Window)
Mark as an Answer
IncludeTag doesn't support IterationTag features
February 13, 2008 7:33 AM
Rank: Junior Member
Join Date: January 8, 2008
I've been working on creating my own taglib, and I've found that using the Liferay IncludeTag (taglib.util) doesn't iteratively evaluate the generated content of a tag. Thus you cannot have your tag's JSP file dynamically output another custom taglib tag.
within your custom-tag.jsp:
String params = StringPool.BLANK;
if (width != null)
"width=\"" + width + "\" ";
StringBuffer tag = new StringBuffer();
tag.append("url=\"" + url + "\" ");
<%= tag.toString() %>
You see that I've inserted a dynamic attribute, which is why I need this iterative evaluation in the first place.
IterationTag (which IncludeTag ultimate implements) is suppposed to support this sort of functionality via the doAfterBody method, but because IncludeTag doesn't use the BodyContent (and instead simply writes the page.jsp directly to PageContext), this functionality isn't accessible.
Can this be fixed in a new version? Or is there some other workaround?
Sign in to vote.
Please sign in to flag this as inappropriate.