JSP param action tag

The jsp param action tag is used to pass the parameters from JSP to another resource like jsp or servlet.

 

Syntax:

<jsp: param name="paramName" value="paramValue"/>

 

Example:

welcome.jsp

<html>
    <head>
        <title>param action example</title>
    </head>
    <body> 
      <h3>Hello this is a param action example.</h3>
      <jsp:forward page="home.jsp">
         <jsp:param name="websiteName" value="www.w3spoint.com"/>
      </jsp:forward>
    </body>
</html>

 

home.jsp

<html>
  <head>
    <title>param action example</title>
  </head>
  <body>
    <h4>
     This content is of that resource on which request is forwarded.
    </h4>
    <%
    out.print("Website: " + request.getParameter("websiteName")); 
    %>
  </body>
</html>

 

web.xml

<web-app>
 
  <welcome-file-list>
          <welcome-file>welcome.jsp</welcome-file>
  </welcome-file-list>	
 
</web-app>