JSP Scripting Elements
This chapter provides tutorial notes and example codes on JSP Scripting Elements. Topics include what are scripting elements; writing scriptlets, scripting expressions and declarations; converting scripting elements into implementing Java code fragments; example Java class converted from a JSP page; mixing static data with scripting elements.
What Are Scripting Elements?
Converting JSP Pages with Scripting Elements
Example JSP Page with Scripting Elements
Example Java Class Converted from a JSP Page
Mixing Static Data with Scriptlets for Compound Statements
- 3 types of scripting elements are supported in JSP 2.1: scriptlets, scripting expressions and scripting declarations.
- Tomcat 7 converts a JSP page into a Java Servlet class.
- Tomcat 7 converts static data into out.write("data") statements.
- Tomcat 7 converts scriptlets, like <% statement %>, into statements directly as is.
- Tomcat 7 converts script expressions, like <%= expression %>, into out.print(expression) statements.
- Tomcat 7 converts script declarations, like <%! declaration %>, into declaration statements directly as is in the class header section.
Table of Contents
About This Book
JSP (JavaServer Pages) Overview
Tomcat 7 Installation on Windows Systems
►JSP Scripting Elements
Java Servlet Introduction
JSP Implicit Objects
Syntax of JSP Pages and JSP Documents
JSP Application Session
Managing Cookies in JSP Pages
JavaBean Objects and "useBean" Action Elements
Managing HTTP Response Header Lines
Non-ASCII Characters Support in JSP Pages
Performance of JSP Pages
EL (Expression Language)
Overview of JSTL (JSP Standard Tag Libraries)
JSTL Core Library
JSP Custom Tags
JSP Java Tag Interface
Custom Tag Attributes
Multiple Tags Working Together
File Upload Test Application
PDF Printing Version