Want to customize a tag lib, we need to do follow the steps:
1. Define the component (UIBean)
2. Define the tag
3. Define freemarker template, which should be added to "WEB-INF/classes/template/simple" folder.
We also can change the folder to template/xhtml, which is related with struts theme.
4. Define the tag configuration file, which should be added to "WEB-INF/tld/tms-tags.tld"
5. Configure the web.xml to load the tag lib when server is up.
6. Use the tag lib in jsp
Ok, you'll see the result when visit the jsp.
Say hello to: Stefli
本文介绍如何通过六个步骤定制Struts2标签库,包括定义组件、标签、Freemarker模板、配置文件等,并展示了使用自定义标签的具体示例。
673

被折叠的 条评论
为什么被折叠?



