JSP Action Elements



JSP Action Element :

  1. JSP Action elements are used to control the behavior of the Servlet Engine.
  2. JSP Action elements can be used to insert the code dynamically into JSP and allows us to reuse the JavaBeans
  3. JSP have different type of action elements that are used to do certain tasks.
  4. JSP Action elements can be used as alternative to JSP Scriptlets for inserting the dynamic code in the page.

Syntax :

<jsp:action_name attribute="value" />

Above is the basic syntax for the JSP action element. We can use the prefix jsp for indicating the JSP action element.

Action Tag Description
jsp:include Include the runtime response of a JSP page.
jsp:forward Forwarding the request to a new page
jsp:element Defines XML elements dynamically
jsp:attribute defines dynamically defined XML element’s attribute
jsp:plugin Generates client browser-specific construct that makes an OBJECT or EMBED tag for the Java Applets
jsp:param Adds parameters to the request
jsp:fallback Supplies alternate text if java applet is unavailable on the client
jsp:body Used within standard or custom tags to supply the tag body.
jsp:text Use to write template text in JSP pages and documents.
jsp:getProperty Retrieval of a property from a JavaBean instance.
jsp:setProperty store data in JavaBeans instance.
jsp:useBean instantiates a JavaBean

In the upcoming chapters we will be looking into more details about these action elements.