JSP Tutorials - Herong's Tutorial Examples
∟JSTL Core Library
∟c:set Action Tag
This section describes the c:set action tag in the JSTL Core library. c:set allows you to set the value of a scoped variable or a property of a target object.
The <c:set> action tag allows you to set the value of a scoped variable or a property of a target object
in JSP pages using this syntax:
<c:set var="name" value="expression" scope="level"/>
<c:set var="name" scope="level">
expression
</c:set>
<c:set target="targetName" property="propertyName"
value="expression"/>
<c:set target="targetName" property="propertyName">
expression
</c:set>
Note that:
- "name" provided in the "var" attribute specifies the name of an EL variable, which is really
an attribute in the pageContext object.
- "expression" provided in the "value" attribute or in the element content specifies the EL expression
to be evaluated, converted to a string and assigned to the specified variable or target property.
- "level" provided in the "scope" attribute specifies the scope level of the variable:
page, request, session, and application.
- "targetName" provided in the "target" attribute specifies an object target like JavaBean or
java.util.Map object that support properties.
- "propertyName" provided in the "property" attribute specifies the name of a property in the target object.
Table of Contents
About This Book
JSP (JavaServer Pages) Overview
Tomcat 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
What Is JSTL Core Library
c:out Action Tag
c:out Action Tag with EL Expressions
►c:set Action Tag
c:if Action Tag
c:choose Action Tag
c:forEach Action Tag
c:forTokens Action Tag
Example - Dumping EL Implicit Objects
Example - Calculating Prime Numbers
JSP Custom Tags
JSP Java Tag Interface
Custom Tag Attributes
Multiple Tags Working Together
File Upload Test Application
Using Tomcat on CentOS Systems
Using Tomcat on macOS Systems
Connecting to SQL Server from Servlet
Developing Web Applications with Servlet
Archived Tutorials
References
Full Version in PDF/EPUB