fragment « Tag « JSP-Servlet Q&A

1. How to create a Macro/Snippet/HTML Fragment/Named section in JSP without using tags/includes/JSPFragments?

This might be a very newbie question, but I didn't find anything satisfying I want to do somethign like this in JSP (out of the box preferably): e.g. in a file called products.jsp ...

2. Include jspf file with custom tag

How can I add jspf file to jsp page via custom tag? In the tag support class I can add code of jspf using....

JspWriter writter = this.pageContext.getOut();
writter.append( "html code");
But what shall ...

3. How to use JSP tags in JSP fragment?

Can anyone tell me if you can use JSP tags like this:

<c:if test="true" > ... </c:if> 
In fragments of JSPs with a .jspf extension which are embedded into JSPs using include, ...

4. Using JSP-Fragments outside of the tag where it was defined

I want to define a template using a JspFragment. That's why I created the following Tag class:

public class CreateTemplateTag extends SimpleTagSupport {

    private String name;