Copyright © tutorialspoint.com
The <c:param> tag allows proper URL request parameter to be specified with URL and it does any necessary URL encoding required.
Within a <c:param> tag, the name attribute indicates the parameter name, and the value attribute indicates the parameter value:
The <c:param> tag has following attributes:
Attribute | Description | Required | Default |
---|---|---|---|
name | Name of the request parameter to set in the URL | Yes | None |
value | Value of the request parameter to set in the URL | No | Body |
If you need to pass parameters to a <c:import> tag, use the <c:url> tag to create the URL first as shown below:
<c:url value="/index.jsp" var="myURL"> <c:param name="trackingId" value="1234"/> <c:param name="reportType" value="summary"/> </c:url> <c:import url="${myURL}"/> |
Above request would pass URL as below - Try it yourself.
"/index.jsp?trackingId=1234;reportType=summary" |
Copyright © tutorialspoint.com