0% found this document useful (0 votes)
16 views2 pages

Standard Actions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

Standard Actions - <jsp:forward>: This action tag is used to forward a request from one JSP page

to another JSP page This action tag internally uses RequestDispatcher forward() method This action
tag can be used to communicate JSP to JSP page : <jsp:forward page="b.jsp"/> JSP to servlet : <
jsp:forward page="srv1"/> JSP to HTML : <jsp:forward page="b.html"/> Standard Actions - <
jsp:param/params> <jsp:param> When a request is forwarded from one JSP to another then
automatically request parameters are also forwarded to another JSP. For example: <jsp:param
name="email" value="[email protected]"/> <jsp:params> If more than one <jsp:param> tag is used then
we should put them in <jsp:params> tag. For example: <jsp:params> <jsp:params
name="email" value="[email protected]"/> <jsp:params name="hobby" value="reading"/> </jsp:params

Java Bean Components: <jsp:usebean> In a web application it same business logic is required in
multiple JSP pages then to make that business logic as reusable it will be separated from JSP pages
to a java class. This java class is called a bean class. A bean is nothing but it is reusable software
component. <jsp:setProperty> This action tag is used to set the values to bean class properties by
calling setter methods. <jsp:setProoerty> tag must be used inside of <jsp:useBean> tag. <
jsp:getProperty> This tag is used to read the values of a bean class property by calling getter
method of the property. This tag has only two attributes name and property. This tag should be used
at outside of <jsp:useBean> tag.

You might also like