Taglibs are a collection of Java Classes that follow the Java Beans model ,and implement a particular function ( like iterating thru a collection or a recordset).These functions are accesible in JSP using custom tags.
Custom tags are similar to ordinary tags in HTML like <HTML>/<HTML> , <BODY>/<BODY>.
You can specify your own name for these with a set of attributes foe each tag. Each tag would have a TagHandler class ( the Java Class I mentioned above), that would implement a Tag Interface or
derivative of it (javax.servlet.jap.tagext.*). The TagHandler would need to have a setter method for each of the attributes.
The Tag Handler would implement the exact function of the Tag and a TagLibraryDescriptor (which is a XML file) would create a mapping between the tag handler class and the tag name.
It would also contain additional details on the attributes, their types,variable defined by the tag if any ,and auxiallary calsses to validate the tags.
eg:
<foo:customtag attri1="val1" attr2="val2">
//Body of the tag
</foo:customtag>