JSTL - Core <c:param> Tag


Advertisements

The <c:param> tag allows proper URL request parameter to be specified with URL and also does the necessary URL encoding required.

Within a <c:param> tag, the name attribute indicates the parameter name, and the value attribute indicates the parameter value −

Attribute

The <c:param> tag has the 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

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 −

<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}"/>

The above request will pass the URL as below - Try it yourself.

"/index.jsp?trackingId=1234;reportType=summary"
jsp_standard_tag_library.htm

Useful Video Courses


Video

JSP, Servlet, JSLT + Hibernate: A complete guide

108 Lectures 11 hours

Chaand Sheikh

Video

Full Stack Java developer - Java + JSP + Restful WS + Spring

Best Seller

517 Lectures 57 hours

Chaand Sheikh

Video

Servlets and JSP Tutorial For Beginners!

41 Lectures 4.5 hours

Karthikeya T

Video

JSP and Servlets - The Complete Course

42 Lectures 5.5 hours

TELCOMA Global

Video

JSP and Servlets Bootcamp: Web Applications for Beginners

15 Lectures 3 hours

TELCOMA Global

Video

JSP (Java Server Pages) Certification Training

44 Lectures 15 hours

Uplatz

Advertisements