Thursday, 19 January 2017

What are the standard actions available in JSP?

What are the standard actions available in JSP?
The standard actions available in JSP are as follows:
<jsp:include>: It includes a response from a servlet or a JSP page into the current page. It differs from an include directive in that it includes a resource at request processing time, whereas the include directive includes a resource at translation time.
<jsp:forward>: It forwards a response from a servlet or a JSP page to another page.
<jsp:useBean>: It makes a JavaBean available to a page and instantiates the bean.
<jsp:setProperty>: It sets the properties for a JavaBean.
<jsp:getProperty>: It gets the value of a property from a JavaBean component and adds it to the response.
<jsp:param>: It is used in conjunction with <jsp:forward>;, <jsp:, or plugin>; to add a parameter to a request. These parameters are provided using the name-value pairs.
<jsp:plugin>: It is used to include a Java applet or a JavaBean in the current JSP page.

What is the <jsp:useBean> standard action?
The <jsp:useBean> standard action is used to locate an existing JavaBean or to create a JavaBean if it does not exist.

What is the <jsp:forward> standard action?
·         The <jsp:forward> standard action forwards a response from a servlet or a JSP page to another page.The execution of the current page is stopped and control is transferred to the forwarded page.
·         The syntax of the <jsp:forward> standard action is : 
<jsp:forward page="/targetPage" />.
What is the <jsp:include> standard action?
·         The <jsp:include> standard action enables the current JSP page to include a static or a dynamic resource at runtime.
·         In contrast to the include directive, the include action is used for resources that change frequently. The resource to be included must be in the same context.
·         The syntax of the <jsp:include> standard action is as follows:
<jsp:include page="targetPage" flush="true"/>
Here, targetPage is the page to be included in the current JSP

No comments:

Post a Comment