The XML is getting more and more popular, and there are many advantages to use XML. Luckily, the jsp pages can be represented by XML.
Benefits of writing JSP pages as XML document: (Reference: A Developer's Guide to J2EE Solutions)
1. The content of the JSP page can be validated against a set of descriptions.
2. The JSP page can be manipulated using an XML tool.
3. The JSP page can be generated from a textual representation by applying an XML transformation.
Directives:
<%@ directive key=value key=value%> ----> <jsp:directive.directiveName attribute_list/>
directive can be page, include, taglib
<%@ page name=value%> ----> <jsp:directive.page attribute_list/>
<%@ include %> ----> <jsp:directive.include attribute_list/>
<%@taglib %> ----> <jsp:directive.taglib attribute_list/>
Scripting elements:
scriptlets <% ... %> -----><jsp:scriptlet>script</jsp:scriptlet>
declaration <%! ... %> -----><jsp:declaration>declaration code <jsp:declaration>
expressions <%= ... %> -----><jsp:expression>expression</jsp:expression>
Template Data
<jsp:text> text </jsp:text>