JSTL Param Tag is used to pass the parameters to the url.
JSTL Param Tag Example
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>JSTL Param Tag Example</title> </head> <body>
<c:url value="http://www.mystore.com" var="storeLink"> <c:param name="productId" value="20"></c:param> </c:url> <c:import url="${storeLink}"></c:import> </body> </html>
As you can see above, JSTL Param Tag is being used within <c:url> tag. In the <c:param> tag, name attirbute is used to define the parameter name and value attribute is used to set the value of the parameter.
In the above example, parameter productId is appended to the url with value 20. In <c:import> tag, the url attribute will have following value.
http://www.mystore.com?productId=20
Attributes of <c:forTokens> tag are:
Required Attributes:
1. name:This attribute provides name of the query string parameter.
Optional Attributes:
1. value: This attribute provides value of the parameter.