But later in the project, you want to choose the shade of blue. All of your old tags still work to produce blue text, but now you can use the same tag to produce blue text of any shade. Tags promote code reuse. Code that is used over time has been more thoroughly tested and will have fewer bugs. As a result, JSP pages that use custom tags will have fewer bugs and be easier to maintain.
Tag libraries offer an easy way to reuse code.
One of the standard ways to reuse code in a server-side language is to use templates. A tag library is a far better solution compared to a template library. With a template library you have to either keep modifying the template to work for each project, or build rigid interfaces. Tag libraries have neither of these limitations, and yet have all the benefits of object orientation to make them flexible and expandable. Also, since you are reusing code, less time is spent developing it and more can be used in designing your Web application.