Actions use constructs in XML syntax to control the behavior of the servlet engine. You can dynamically insert a file, reuse JavaBeans components, forward the user to another page, or generate HTML for the Java plugin.
There is only one syntax for the Action element, as it conforms to the XML standard −
<jsp:action_name attribute = "value" />
Action elements are basically predefined functions. The following table lists out the available JSP actions −
S.No. | Syntax & Purpose |
---|---|
1 | jsp:include Includes a file at the time the page is requested. |
2 | jsp:useBean Finds or instantiates a JavaBean. |
3 | jsp:setProperty Sets the property of a JavaBean. |
4 | jsp:getProperty Inserts the property of a JavaBean into the output. |
5 | jsp:forward Forwards the requester to a new page. |
6 | jsp:plugin Generates browser-specific code that makes an OBJECT or EMBED tag for the Java plugin. |
7 | jsp:element Defines XML elements dynamically. |
8 | jsp:attribute Defines dynamically-defined XML element's attribute. |
9 | jsp:body Defines dynamically-defined XML element's body. |
10 | jsp:text Used to write template text in JSP pages and documents. |