Skip to Content
JavaServer Pages, 3rd Edition
book

JavaServer Pages, 3rd Edition

by Hans Bergsten
December 2003
Intermediate to advanced
764 pages
24h 58m
English
O'Reilly Media, Inc.
Content preview from JavaServer Pages, 3rd Edition

Setting Action Attribute Values

Let’s talk about the “Java type” and “Dynamic value accepted” column values in Table 7-1. The category attribute value for the <ora:motd> action has the value String in the “Java type” column. String is the Java type for a text value. Action attributes can be of any Java type, the same as the bean properties discussed in Chapter 6. Say, for instance, that the <ora:motd> action had another attribute for setting the number of messages to return. It would make sense for this attribute to be of type int (a whole number). The container treats attribute values the same as bean properties and automatically converts text values to numeric and Boolean values, using the same conversion methods, so this attribute could still be set as a text value. The same as for a bean, a Java programmer can also link a property editor to a custom action to convert text values to more complex data structures.

A custom action attribute may also accept an EL expression as well as a static text value. An EL expression is evaluated for each page request, so it allows you to provide an attribute value that differs between invocations. The value in the “Dynamic Value Accepted” column tells if the attribute can be set by an EL expression. As you can see in Table 7-1, the category attribute for the <ora:motd> action does accept an EL expression. Support for EL expressions isn’t a given, but typically all attributes except those named var and scope accept an EL expression value (a ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

More Servlets and JavaServer Pages™

More Servlets and JavaServer Pages™

Marty Hall

Publisher Resources

ISBN: 0596005636Errata Page