Unit 3 JST, JSTL, HTML Form
Unit 3 JST, JSTL, HTML Form
• JSP supports nine automatically defined variables, which are also called implicit objects.
Out of them 3 variables are −
1) request
This is the HttpServletRequest object associated with the request.
2) response
This is the HttpServletResponse object associated with the response to the client.
3) Out
This is the PrintWriter object used to send output to the client.
JSTL library
• The Java Server Pages Standard Tag Library (JSTL) is a collection of useful JSP tags which
encapsulates the core functionality common to many JSP applications.
• JSTL has support for common, structural tasks such as iteration and conditionals, tags
for manipulating XML documents, internationalization tags, and SQL tags.
• It also provides a framework for integrating the existing custom tags with the JSTL tags.
• To install JSTL library compatible with our servlet and JSP version
Link is:
http://www.java2s.com/Code/Jar/j/Downloadjavaxservletjspjstl30jar.htm
• To use any of the libraries, you must include a <taglib> directive at the top of each JSP
that uses the library.
JSTL library
Classification of The JSTL Tags:
The JSTL tags can be classified, according to their functions, into the following JSTL tag
library groups that can be used when creating a JSP page −
• Core Tags
• Formatting tags
• SQL tags
Note :
That all the JSTL standard tags URL starts with
• XML tags https://java.sun.com/jsp/jstl/ and we can use any prefix we
want but it’s best practice to use the prefix defined above
• JSTL Functions
JSTL library
Classification of The JSTL Tags-
1) Core Tags:
JSTL Core tags provide support for
1. iteration,
2. conditional logic,
3. catch exception,
4. url,
5. forward or redirect response etc.
To use JSTL core tags, we should include it in the JSP page like below.
<%@ taglib uri="https://java.sun.com/jsp/jstl/core" prefix="c" %>
JSTL library
Classification of The JSTL Tags-
2) Formatting Tags:
JSTL Formatting tags are provided for
1. formatting of Numbers,
2. Dates and i18n support through locales and resource bundles.
We can include these jstl tags in JSP with below syntax:
http://www.test.com/hello?key1=value1&key2=value2
The GET method is the default method to pass information from the browser to
the web server and it produces a long string that appears in your browser's
Location:box.
• Using GET Method-
Ex: