nested jsp tags!!
Hi,
I have two custom jsp tags that both work fine when i call each one individually! however when they are nested i get an exception cause the inner tag is not resolved before resolving the outer one. And the outer one expect the output of the inner tag, not the inner tag itself.
There you are my nester tag:
<@calendartag.calendar cssPrefix="mini" weekStart="sunday" dayWidth="20" dayHeight="20" id="minical" date="${SELECTEDdate?string('MM/dd/yyyy')}" startDate="${startDate!}" endDate="${endDate!}"
requestURI="<@portlet.actionURL/>"/>
The outer one is: <@calendartag...
The inner one is: <@portlet.actionURL...
can you please solve this problem.? The problem is that for both tags i'm not the developer of both. If i were the developer i would have managed to do accept having the tag itself other than its output
any comments?
thanks in advance
# 1
You may find it has some strange annotations that are not used usually in jsp tags.
The code i pasted in the previous msg is integrated with Freemarker that supports jsp tags. However, plz keep focusing on the idea of nested jsp tags, don't think of freemarker since it has nothing to do with the problem i have!
thanks
# 2
You can't use custom tags as attributes to other custom tags. You can only use expressions. Alternatively you can nest the tags one inside another.
If you are using JSTL, you might try it like this:
<c:set var="calendarURI"><@portlet.actionURL/></c:set>
<@calendartag.calendar requestURI="${clanedarURI}"/>
Basically it just stores the result of executing the @portlet.actionURL as an attribute, and then uses a ${expr} to include it in the second tag.
Cheers,
evnafets
# 3
thanks it works in terms of jsp tags, however, since i'm using free marker, the freemarker processer now thinks of ${clanedarURI} as its own variable since free marker uses ${varKey} annotation the same way jsp does. and since the variable ${clanedarURI} is not defined for freemarker in my FTL (FreeMarker Template) it throws an exception.
I have asked this question in FreeMarker forum since this question is not a jsp question but if you know the answer of how to avoid it, plz do so!
thanks in advance
cya