The taglib directive is used to define tag library that the current JSP page uses. A JSP page might include several tag library. JavaServer Pages Standard Tag Library (JSTL), is a collection of useful JSP tags, which provides mahy commonly used core functionalities. It has support for many general, structural tasks such as iteration and conditionals, readymade tags for manipulating XML documents, internationalization tags, and for performing SQL operations.
Let’s imagine you want to create a web page which needs you to write same code many times for each particular like in e commerce website, you might have to show price tags, size and color along with an image for each item.
You have to show 10 items or more in single page. Now, instead of writing the HTML, css code many times, you can create something tag-lib where you can create a method in a class which accepts a list of parameters and you can call that method.
You can embed html and css code in the method and you can design the UI of the page by just writing a single line of code by passing parameters to it.
Here are some of the screenshots:
https://stackoverflow.com/questions/27279217/what-is-a-taglib
No comments:
Post a Comment