In this Section, we will discuss about "jsp:param" standard action & their utilization with a example.
Basically, <jsp:param> is use to pass one or more name/value pairs as request parameters to other resources like JSP page, servlet or other resource that can process the parameter. This tag can be enclose in any other action tags, where passing of parameters is required, for example--<jsp: forward> & <jsp:include>
The name attribute specifies the parameter name and takes a case-sensitive literal string. The value attribute specifies the parameter value and takes either a case-sensitive literal string or an expression that is evaluated at request time.
In this example we are passing a parameters to a file by using <jsp: forward> tag. Inside this tag we have used the tag <jsp: param>. This tag is used to pass the name and values to the targeted file. These parameters will be retrieved by the targeted file by using "request.getParameter()" method.
<jsp:param name="myParam" value="ANKIT KAUSHAL"/>
<jsp:param name="Age" value="15"/>
This page has 2 forwarded parameters :<br>
<b>Name:</b> <%= request.getParameter("myParam") %><br>
<b>Age:</b> <%= request.getParameter("Age") %>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.