Write jsp with xml

来源:互联网 发布:linux查找log日志命令 编辑:程序博客网 时间:2024/05/01 15:42

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>

原创粉丝点击