JSTL Core tag – param() : Function

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

JSTL Example :

If you need to pass parameters to a <c:import> tag, use the <c:url> tag to create the URL first as shown below:


<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<title>JSTL Tag Example</title>

<c:url value="output.jsp" var="generatedURL">
   <c:param name="name" value="Programming Tutorials"/>
   <c:param name="url" value="www.c4learn.com"/>

<c:import url="${generatedURL}"/>



Website Name : <%= request.getParameter("name")%><br />
URL : <%= request.getParameter("url")%>

Output :

It would call following url –


Output produced on the output.jsp will be –

Website Name : Programming Tutorials
URL : www.c4learn.com