Types of Scripting Elements
Expressions
Format: 
<%= expression %>
Evaluated and inserted into the servlet's output. I.e., 
results in something like out.println(expression)
Scriptlets
Format: 
<% code %>
Inserted verbatim into the servlet's _jspService method 
(called by service)
Declarations
Format: 
<%! code %>
Inserted verbatim into the body of the servlet class, 
outside of any existing methods
21
JSP
www.corewebprogramming.com
JSP Expressions
Format
<%=
Java Expression 
%>
Result
Expression evaluated, converted to String, and placed 
into HTML page at the place it occurred in JSP page
That is, expression placed in _jspService inside out.print
Examples
Current time: <%= new java.util.Date() %>
Your hostname: <%= request.getRemoteHost() %>
XML compatible syntax
Java Expression
XML version not supported by Tomcat 3. Until JSP 1.2, 
servers are not required to support it.
22
JSP
www.corewebprogramming.com
11




  

Home

About Services Network Support FAQ Order Contact
 

Java Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved