trainingtrains Logo

91-9990449935

 0120-4256464

JSP Action Tags

There are many JSP action tags or elements. Each JSP action tag is used to perform some specific tasks.

The action tags are used to control the flow between pages and to use Java Bean. The Jsp action tags are given below.

JSP Action TagsDescription
jsp:forwardforwards the request and response to another resource.
jsp:includeincludes another resource.
jsp:useBeancreates or locates bean object.
jsp:setPropertysets the value of property in bean object.
jsp:getPropertyprints the value of property of the bean.
jsp:pluginembeds another components such as applet.
jsp:paramsets the parameter value. It is used in forward and include mostly.
jsp:fallbackcan be used to print the message if plugin is working. It is used in jsp:plugin.

The jsp:useBean, jsp:setProperty and jsp:getProperty tags are used for bean development. So we will see these tags in bean developement.


jsp:forward action tag

The jsp:forward action tag is used to forward the request to another resource it may be jsp, html or another resource.

Syntax of jsp:forward action tag without parameter

Syntax of jsp:forward action tag with parameter


Example of jsp:forward action tag without parameter

In this example, we are simply forwarding the request to the printdate.jsp file.

index.jsp

printdate.jsp


Example of jsp:forward action tag with parameter

In this example, we are forwarding the request to the printdate.jsp file with parameter and printdate.jsp file prints the parameter value with date and time.

index.jsp

printdate.jsp

Next TopicJsp Include Action