%@ page import="java.util.*" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
EcmaScript uses the dot (.) notation to access elements of an object. The . operator expects an object as its left operand and the name of an object property as its right operand. The right operand should not be a string or a variable that contains a string but should be the literal name of the property without quotes.
Here is an example:
<% request.setAttribute("myDate", new Date()); %>Object | Property | Value |
---|---|---|
prop | prop.getKey() | |
Date | Date.toString() | |
Date | Date.getYear() |