Hi,
The JSP fragment is JSP code without scripting codes. Actually JspFragment is Object which encapsulate JSP code into it that can be invoked as many times as needed.
The JSP fragments can be in the body of the SimpleTag handler. The fragment in the body is executed when the <jsp
oBody> tag is encountered.
The invokation of tag in JSP file is
<%taglib prefix="test" tagdir="/WEB-INF/tags" %>
<
test:tag1>
This body is treated as JSP fragment. It should not contain scripting. and the body-content should be "scriptless"
</test:tag1>
Also you can pass JSP frgment as attribute and the fragment can be executed by <jsp:invoke > standard tag.
The invokation of tag in JSP file is
<%taglib prefix="test" tagdir="/WEB-INF/tags" %>
<test:tag2>
<jsp:attribute name='frag1'>
This attribute value is treated as JSP fragment. It should not contain scripting.
</jsp:attribute>
</test:tag2>
You can also use the jsp fragment in Simple and custom tags in the attribute values. To do this you have to set the foollwing attribute options in tld file while defining the tag .
Assuming that the setter method in the tag implementation set the frag2 attribute in the tag correctly,
Then you can inoke this fragment attribute using the
frag2.invoke(null);
Hope this help
[ July 10, 2006: Message edited by: Narendra Dhande ]