Value Type Conversion

This section describes basic rules on how JSP server determines which setter method to call and how to convert the attribute value to match the setter method parameter.

In my previous example, the attribute value is passed to the tag object property as a string data type. Can we pass attribute values to tag object as other data types or objects? The answer is yes. JSP tag extension facility will try to convert attribute values to the data types of the tag object properties. I couldn't find any official specifications on the match rules. The following is my guesses:

Last update: 2012.

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

 Tag Attributes Are Tag Object Properties

 Setter Method Example -

Value Type Conversion

 Value Type Conversion Example -

 Accepting EL Expressions

 Accepting EL Expression Example

 Passing Expression as String Example

 Using jsp:attribute Action Elements

 Multiple Tags Working Together

 File Upload Test Application

 Outdated Tutorials


 PDF Printing Version