JSP API

This tutorial lists down the API’s used in the Java Server Pages (JSP) programming. API stands for Application Programming Interface that allows programmers for building software applications in java. JSP API is categorized into following packages:

PackagesDescription
javax.elIt provides classes and interfaces used by JSP to evaluate expressions.
javax.servelt.jspIt contains classes and interfaces that describe JSP page implementation.
javax.servlet.jsp.elIt contains classes ang interfaces that define JSP page implementation supported by JSP container.
javax.servlet.jsp.tagextIt is used to define tag libraries which means for identifying custom tags in JSP page.

Following sections will detail about classes and interfaces in each of the above packages:

Package javax.servlet.jsp

It contains classes and interfaces that describe JSP page implementation.

Interfaces

InterfaceDescription
JspPageIt contains interaction of JSP page implementation.JspPage page has following methods :

  • JspInit:it is used to initialize JSP page.
  • JspDestroy:It is used to remove JSP page.
HttpJspPageIt contains interaction of JSP page implementation with HTTP protocol.It has method called _jspService used to process user request.

Classes

ClassDescription
JsPWriterIt is used to display contents/output in JSP page.
JspErrorIt is used to display errors on error pages.
JspContextIt collects information which is not a part of servlets.
JspEngineInfoIt gives information of current JSP engine.
JspFactoryIt defines classes and interfaces to use JSP page implementation.
JspExceptionIt is used to display exceptions occurred in JSP pages.

Package javax.el

This package has classes and interfaces for the expression language definitions.

Interfaces

InterfaceDescription
ELContextListenerIt is used for receiving notification.

Classes

ClassesDescription
ArrayELResolverPerforms property resolution on arrays.
BeanELResolverPerforms property resolution on JavaBeans.
CompositeELResolverIt can be used as stop condition for iterating its component resolvers.
ELContextStores state of EL expressions.
ELContextEventIndicates ELContext has been created.
ELResolverDefines resolution rules to resolve EL expressions.
ELUtilDefines utility methods for EL implementation.
ExpressionIt is base class for ValueExpression and Method Expression.
ExpressionfactoryIt is used to convert string into value or method expressions.
FunctionMapperIt is used to map function names and methods.
ListELResolverPerforms property resolution on objects of List class.
MapELResolverPerforms property resolution on objects of map class.
MethodExpressionIt is used to parse expressions to method.
MethodInfoIt defines information about Method Expression.
ResourceBundleELResolverPerforms property resultion on objects of ResourceBundle class.
ValueExpressionIt is used to parse expressions to value.
VariableMapperIt is used map between expressions and variables.

Exceptions

Exception NameDescription
ELExceptionRepresents the exceptions occurred during evaluation of expressions.
MethodNotFoundExceptionIt returns exception when method could not found while evaluating expressions.
PropertyNotFoundExceptionIt returns exception when property could not found while evaluating expressions.
PropertyNotWritableExceptionIt returns exception when property could not written to value on a ValueExpression.

Package javax.servlet.jsp.el

Interfaces

Interface NameDescription
FunctionMapperIt is used to map between function names and methods.
VariableResolverit is used to resolve references of variables at evaluation time.

Classes

Class NameDescription
ExpressionIt is base class for Value Expression and Method Expression.
ExpressionEvaluatorIt is used to evaluate variables and expressions at run time.
ImplicitObjectElResolverIt describes behavior of implicit objects in JSP specification.
ImplicitObjectELResolver.EnumeratedMapIt provides enumeration of keys and getValue method.
ImplicitObjectElResolver.implicitObjectsit is used to create implicit map and list objects.
ScopedAttributeELResolverIt performs property resolution on scoped attributes.

Exceptions

Exception nameDescription
ELExceptionIt represents exceptions that occurred during expression evaluation.
ELParseExceptionIt represents parsing exceptions occurred during expression evaluation.

Package javax.servlet.jsp.tagext

This package has classes and interfaces for writing the custom tags.

Interfaces

Interface NameDescription
BodyTagIt includes contents of evaluating body.
DynamicAttributsA tag must implement this interface to define dynamic attributes.
iterationTagIt is used to control re-evaluation of body.
JspIdConsumerIt defines ID for user provided by compiler.
JspTagIt provides base class for tag and Simpletag.
SimpleTagIt defines interface for simple tag handlers.
tagit does not manipulate its body.
TryCatchFinallyIt provides extra methods to manage resources.

Classes

Class NameDescription
BodyContentIt is a subclass of JspWriter. It has methods to convert its contents into a String, to read its contents, and to clear the contents.
BodyTagSupportIt implements the BodyTag interface and we can add additional functionalities to set property of bodyContent .
FunctionInfoIt provides information in TagLibrary.This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
JspfragmentIt is an object that represents JSP code.
PageDataIt provides information on a JSP page.
SimpletagSupportIt is used as base class for simple tag handlers. It adds additional methods for the properties in SimpleTag.
TagAdapterIt is used to allow collaboration between classic Tag handlers and SimpleTag handlers.
TagAttributeInfoIt provides information on attributes of a tag.
TagDataIt gives value information for a tag instance only at translation time.
TagExtraInfoIt is used to describe additional information which is not defined in TLD( Tag Library Descriptor)file.
TagFileInfoIt provides information for a tagfile in TagLibrary only at translation time.
TagInfoIt provides information for a tag in TagLibrary only at translation time.
TagLibrarynfoIt provides information associated with a taglib directive.
TagLibraryValidatorIt is validator class for a JSP page and operates on the XML view associated with the JSP page.
TagSupportIt is base class for defining new tag handlers.
TagVariableInfoIt provides variable information for a tag in Tag Library only at translation time.
ValidationMessageIt display validation message from either TagLibraryValidator and TagExtraInfo.
VariableInfoIt provides information on scripting variables that are created or modified at run time.

Previous Tutorial : JSP Redirect || Next Tutorial : Session Tracking in JSP

Comments

comments

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Speak Your Mind

*