JSTL param Tag <c:param>

JSTL Param Tag is used to pass the parameters to the url. 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.

JSTL <c:param> Tag Example:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<title>c:forTokens Tag Example</title>
<c:url value="/footer.jsp" var="myURL">
   <c:param name="employeeId" value="1234"/>
   <c:param name="employeeName" value="Dinesh"/>
<c:import url="${myURL}"/>

As you can see above, JSTL Param Tag is being used within <c:url> tag. In the <c:param> tag, name attribute is used to define the parameter name and value attribute is used to set the value of the parameter.

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.

<<Previous <<   || Index ||   >>Next >>

No comments:

Post a Comment