JSP Elements

Template Text

It contains HTML and XML tags and raw data .For the template text no processing is required and it will be passed directly as argument to out.write() in _jspService() method.

Example:
TemplateText

The generated Servlet is

_jspService(--)...{
 out.write("<h1>The server time is:");
 out.print(new java.util.Date());
 out.write("</h1>");
}

Note:
Template text is always treated as character data and hence it will be passed as argument to out.write() method.
Expression value can be of any data type and hence compulsory we should go for print() method.In this case we can’t use write() method because it handles only character data.