|
|
JSP标签集成指南 |
|
1. 与JSP集成 (注:在JSP中使用CTL)
test.jsp:
<%@taglib uri="commontemplate" prefix="ct" %>
<ct:template>
CTL...
</ct:template>
如果服务器不支持Servlet2.4或以上版本, 需在web.xml中配置tld的引用:
<taglib>
<taglib-uri>commontemplate</taglib-uri>
<taglib-location>/WEB-INF/commontemplate.tld</taglib-location>
</taglib>
2. 与TagLib集成 (注:在CTL中使用JSP标签)
配置commontemplate.properties:
行指令:
directive{textfield}=org.commontemplate.standard.directive.taglib.TagLineDirectiveAdapter()
directive{textfield}.tagClassName=org.apache.struts2.views.jsp.ui.TextFieldTag
块指令:
directive{grid}=org.commontemplate.standard.directive.taglib.TagBlockDirectiveAdapter()
directive{grid}.tagClassName=org.apache.struts2.views.jsp.ui.GridTag
|
|
|