How to use JSTL (JSP Standard Tag Library)
[Pages:43]Chapter 9
How to use JSTL
(JSP Standard Tag Library)
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 1
Objectives
Applied 1. Use the JSTL core library with EL to add functionality to JSPs. 2. Use the documentation for the JSTL libraries to learn about other
JSTL capabilities.
Knowledge 1. Describe the use of these JSTL tags: out, forEach, forToken, if,
choose, import, and url.
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 2
The primary JSTL libraries
Name Prefix URI
Core
c
Formatting fmt
SQL
sql
XML
x
Functions fn
Description
Core tags for common tasks such as looping and if/else statements.
Tags for formatting numbers, times, and dates so they work correctly with internationalization (i18n).
Tags for working with SQL queries and data sources.
Tags for manipulating XML documents.
Functions that can be used to manipulate strings.
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 3
NetBeans with the JSTL 1.2 library added
A taglib directive for the JSTL core library
A JSTL out tag
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 4
An introduction to JSTL
The JSP Standard Tag Library (JSTL) provides tags for common JSP tasks.
Before you can use JSTL tags within an application, you must make the jstl-impl.jar and jstl-api.jar files available to the application. To do that with NetBeans, you can add the JSTL 1.2 class library to your project.
Before you can use JSTL tags within a JSP, you must code a taglib directive that identifies the JSTL library and its prefix.
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 5
Browser that displays the JSTL documentation
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 6
XSS attacks
In a cross-site scripting (XSS) attack, an attacker attempts to inject Javascript into your page to trick your users into sending them personal data.
To prevent an XSS attack, use the out tag to escape the output for your application. This tag replaces characters such as the left angle bracket () with their corresponding HTML entities.
It's generally considered a best practice to escape all output that's sent to the browser, including other parts of the HTTP request such as cookies and other headers.
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 7
How to escape output entered by the user
Email: First Name: Last Name:
Output for an XSS attack
Murach's Java Servlets/JSP (3rd Ed.), C9
? 2014, Mike Murach & Associates, Inc.
Slide 8
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- statatutorial princeton university
- using stargazer to report regression output and
- create interesting visualizations in web intelligence
- use a dropdown box to set variable values
- using extendsim
- how to use jstl jsp standard tag library
- data and algorithms variables assignment and input
- smart variables
- lab assignment 1 getting started
- html or hypertext markup language is an easy way to tell
Related searches
- instructions on how to use baking soda to pass a drug test
- how to use money to make money
- how to use baking soda to pass drug test
- how to use to the utmost
- how to use standard deviation formula
- how to use excel to calculate
- how to use standard normal table
- how to use standard normal distribution table
- how to use microsoft to do
- how to use to do
- how to use xcopy to backup files
- how to use standard deviation