What are directives in JSP?

devquora
devquora

Posted On: Mar 22, 2020

 

The JSP directive provides information to the container on how to process the JSP page into its respective servlet.

Syntax

<%@ directive attribute = "value" %> 

There are three JSP directive attributes. They are,

  • <%@ page ... %> - this is a page directive and it provides information about the JSP page like a scripting language, buffering requirements to the container. It has a number of attributes like buffer, autoFlush, contentType, session, etc to provide information.
  • <%@ include ... %> - this is an include directive and it includes files pertaining to the translation phase.
  • <%@ taglib ... %> - this is a tag library directive to define custom user-defined tags.

    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...