Apekshit
  • Home
  • Tutorials
  • Interview Questions
  • About
  • Contact
  • Core JAVA
  • JSP
  • JSTL
  • JDBC
  • Algorithms
  • HTML
  • SQL
  • JavaScript
  • JSP Tutorial
    • JSP Introduction
    • JSP in Eclipse
    • JSP Scripting Elements
    • JSP Directives
    • JSP Page Directive
    • JSP Taglib Directive
    • JSP Include Directive
    • JSP Forward Tag
    • JSP Redirect
    • JSP Forward Vs Redirect
    • JSP Include Tag
    • JSP UseBean Tag
    • JSP SetProperty
    • JSP GetProperty
    • JSP Implicit Objects
    • JSP Request Object
    • JSP Response Object
    • JSP pageContext Object
    • JSP session Object
    • JSP out Object
    • JSP application Object
    • JSP config Object
    • JSP Scopes
    • JSP Page Scope
    • JSP Request Scope
    • JSP Session Scope
    • JSP Application Scope
    • JSP Output Comment
    • JSP Hidden Comment
  • JSTL Tutorial
    • JSTL Introduction
    • JSTL Core Tags
    • JSTL out tag
    • JSTL ForEach Tag
    • JSTL Set Tag
    • JSTL If Tag
    • JSTL Catch Tag
    • JSTL If Else Statement
    • JSTL Choose Tag
    • JSTL Remove Tag
    • JSTL Import Tag
    • JSTL ForTokens Tag
    • JSTL Param Tag
    • JSTL url Tag
    • JSTL Redirect Tag
    • JSTL Functions Tags
    • JSTL Length Function
    • JSTL substringBefore
    • JSTL Substring Function
    • JSTL Trim Function
    • JSTL Replace Function
    • JSTL Contains Function
    • JSTL Join Function
    • JSTL IndexOf Function
    • JSTL split Function
    • JSTL StartsWith
    • JSTL endsWith Function
    • JSTL toLowerCase Function
    • JSTL formatNumber Tag
    • JSTL minFractionDigits
    • JSTL toUpperCase Function
    • JSTL containsIgnoreCase
    • JSTL Formatting Tags
    • JSTL maxFractionDigits
    • JSTL minIntegerDigits
    • JSTL maxIntegerDigits
    • JSTL Format Currency
    • JSTL SQL dateParam Tag
    • JSTL SQL Transaction Tag
    • JSTL SQL Tags
    • JSTL SQL Transaction Isolation Attribute
    • JSTL groupingUsed
    • JSTL SQL SetDataSource
    • JSTL Format Percent
    • JSTL SQL Query Tag
    • JSTL SQL UPDATE Tag
    • JSTL SQL Param Tag
    • JSTL Message Format
    • JSTL Set Locale
    • JSTL Parse Number
    • JSTL escapeXml Function
    • JSTL substringAfter
  • JSP Exception Handling
    • JspTagException
    • JasperException:
    • PropertyNotFoundException
    • javax.servlet.jsp.JspTagException: Don't know how to iterate

JSTL param Tag

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.

JSTL forTokens Tag ⇐ PREVIOUS
NEXT ⇒ JSTL url Tag
Java is a trademark of Oracle.
Apekshit.com is just for learning and testing. To improve basic understanding we provide some examples. We are constantly reviewing it to avoid errors, but we cannot warrant full correctness of all content.