Do Calculation in JSTL C:Out : Output « JSTL « Java Tutorial






<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
  <head>
    <title>JSP is Easy</title>
  </head>
  <body bgcolor="white">

    <h1>JSP is as easy as ...</h1>

    <%-- Calculate the sum of 1 + 2 + 3 dynamically --%>
    1 + 2 + 3 = <c:out value="${1 + 2 + 3}" />

  </body>
</html>
  Download:  JSTLDoCalculationInJSTLCOut.zip( 938 k)







24.2.Output
24.2.1.Output Value
24.2.2.Use JSTL C:Out
24.2.3.Output Form Default Value
24.2.4.Output Default Value
24.2.5.Do Calculation in JSTL C:Out