What are Custom Tags in JSP? How do you create it?

devquora
devquora

Posted On: Feb 22, 2018

 

The custom tags are just user-defined elements that are converted into some operation on an object when the JSP is translated into a servlet. Custom tags are instantiated from the SimpleTagSupport class. With this, scriptlet tag use is removed. And also, the custom tags can be reused.

To create a custom tag in jsp, do the following steps.

  • Create the tag handler class and override the doStartTag() method.
  • Create the TLD file which contains information about the tag and the tag handler class.
  • Create the JSP file and use the created tag in it.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JSP Interview Questions

    Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?

    ErrorPage Attribute process specifies a JSP page that should process any exceptions thrown but not caught in the current page....

    JSP Interview Questions

    Explain What is JSP?

    JSP, expanded as Java Server Pages is a Java-based technology to create dynamic web pages. Released in 1999 by Sun Microsystems, JSP is based on technologies such as HTML, SOAP, XML, etc...

    JSP Interview Questions

    What is the el in JSP?

    The EL (Expression Language) in the JSP is used to access the data stored in the JavaBeans along with implicit objects like requests, sessions, etc...