For quick starter, you can use tag file to create a reusable component for your JSP application. However, if you wants a more serious tag, or need to use Struts’ value stack ability to lookup action variable, it is better to create a Struts component.
The steps are simple:
- Create a Component.
- Create a Tag which extends ComponentTagSupport.
- Create a TLD file.
- Create a freemarker template.
That’s all! This is tested on Struts 2.3.x. Continue reading