+91-9990449935

 0120-4256464

JSP Action Tags (Action Elements)

There are many JSP action tags or elements. Each tag is used to perform some specific tasks. The action tags basically are used to control the flow between pages and to use Java Bean. Jsp action tags are as follows:

  • jsp:forward
  • jsp:include
  • jsp:useBean
  • jsp:setProperty
  • jsp:getProperty
  • jsp:plugin
  • jsp:param
  • jsp:fallback

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