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 out tag

JSTL out tag is used to display information on JSP. It can also be used with properties of the bean.

JSTL c out tag Example:

To display the name of the product on JSP, you can use the <c:out> tag like:

<!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 c out Tag example</title>
</head>
<body>
  <c:out value="${product.name}" default="Not Available" escapeXml="true"></c:out>
</body>
</html>


The above statement assumes that product object is available on this JSP and that product bean has a property name with setters and getters.

Attributes of <c:out> tag are:

   Required Attributes:

       1. value:This attribute needs expression to be evaluated.

  Optional Attributes:

       1. default: This attribute provides default value if the resulting value is null.

       2. escapeXml: This attribute determines whether characters &,'," in the resulting string should be converted to their corresponding character entity codes. Default value is set to true.


JSTL Core Tags ⇐ PREVIOUS
NEXT ⇒ JSTL forEach 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.