what is custom tags with example?

Answer Posted / ravi

Custom tags are 5 type they are
1. simple custom tag
2. param custom tag
3. iterator custom tag
4. body custom tag
5. nested custom tag

if we want write a simple custom tags, we need to follow
these 5 steps
1. we need write directory taglib and uri to ur jsp page
2. we need call custom tag to ur jsp page
3. we need declare taglib uri and taglib loaction in web.xml
4. we need write taglib Discriptor(TLD) file
5. we need write tag handler class

if u want to write tag handler class, our class must
implements tag interface, it available in
javax.servlet.jsp.tagext.Tag package

Tag is an Interface it contains 6 abstract methods and 4
constant variables i.e,

Abstract methods Constants
PageContext EVAL_BODY_INCLUDE
setParent SKIP_BODY
getParent EVAL_PAGE
doStartTag SKIP_PAGE
doEndTag
relase

it contain some more explanation is there....!

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we create an object of static class in java?

589


Can we force garbage collector to run ?

566


How transient variable is different from volatile variable?

554


How we can generate random numbers in java?

599


What are the differences between Java 1.0 and Java 2.0?

1666






What is lexicographically smallest string?

592


What is early binding and late binding in java?

589


What is the difference between Error, defect,fault, failure and mistake?

650


Which data type is a class in java?

567


Can you give few examples of final classes defined in java api?

555


Why does java have two ways to create child threads?

464


What is an infinite loop in java? Explain with an example.

580


What is the program development process?

555


What is field name?

578


What do you understand by looping in java? Explain the different types of loops.

555