前言
一方面,在 JSP 中大家总是不喜欢看到 <% %> 出现在页面上,另一方面,使用 XML 对于前端程序员更友好,所以可以使用 XML 标签代替 JSP 语法。
JSP 对应 XML 标签
JSP | XML |
---|---|
<% %> | <jsp:scriptlet> </jsp:scriptlet> |
<%= %> | <jsp:expression> </jsp:expression> |
<%! %> | <jsp:declaration> </jsp:declaration> |
<%@ page attribute %> | <jsp:directive.page attribute /> |
<%@ include file=" " %> | <jsp:directive.include file=" " /> |