Home > Store

Mastering XPages: A Step-by-Step Guide to XPages Application Development and the XSP Language, Portable Document

Register your product to gain access to bonus material or receive a coupon.

Mastering XPages: A Step-by-Step Guide to XPages Application Development and the XSP Language, Portable Document

eBook (Watermarked)

  • Sorry, this book is no longer in print.
  • About Watermarked eBooks
  • This PDF will be accessible from your Account page after purchase and requires PDF reading software, such as Acrobat® Reader®.

    The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

    Watermarked eBook FAQ

Not for Sale


  • Copyright 2011
  • Dimensions: 7" x 9-1/8"
  • Edition: 1st
  • eBook (Watermarked)
  • ISBN-10: 0-13-248648-2
  • ISBN-13: 978-0-13-248648-4

The first complete, practical guide to XPages development - direct from members of the XPages development team at IBM Lotus

Martin Donnelly, Mark Wallace, and Tony McGuckin have written the definitive programmer's guide to utilizing this breakthrough technology. Packed with tips, tricks, and best practices from IBM's own XPages developers, Mastering XPages brings together all the information developers need to become experts - whether you’re experienced with Notes/Domino development or not. The authors start from the very beginning, helping developers steadily build your expertise through practical code examples and clear, complete explanations. Readers will work through scores of real-world XPages examples, learning cutting-edge XPages and XSP language skills and gaining deep insight into the entire development process. Drawing on their own experience working directly with XPages users and customers, the authors illuminate both the technology and how it can be applied to solving real business problems.

Martin Donnelly previously led a software startup that developed and distributed small business accounting software. Donnelly holds a Commerce degree from University College Cork and an M.S. in Computer Science from Boston University.

Mark Wallace has worked at IBM for 15 years on many projects as a technical architect and application developer.

Tony McGuckin participates in the Lotus OneUI Web Application and iWidget Adoption Workgroup. He holds a bachelor's degree in Software Engineering from the University of Ulster.



Please note that you will have to sign the sample NSFs in the Domino Designer or Admin client before use, as they contain executable code, and thus you must explicitly enable them for security purposes—otherwise, you will get a 403 error (forbidden access). In Designer you can achieve this by right-clicking the application in the design navigator and selecting Application > Sign Design.

Download the Sample Application files

Download the XPages API Java Doc

Sample Content

Sample Pages

Download the sample pages (includes Chapter 9 and Index)

Table of Contents

Foreword by Philippe Riand xx

Preface xxiv

Part I: Getting Started with XPages 1

Chapter 1 An Introduction to XPages 3

XPages Fundamentals 3

Brand New Technology? 4

A Different Development Paradigm 5

The More Things Change, the More Things Stay the Same 7

New Horizons 7

Conclusion 8

Chapter 2 Getting Everything You Need 9

Downloads, Versions, and Locations 9

Installing Domino Designer 10

Installing Client Fix Packs 11

Client Configuration 11

Quick Tour of Domino Designer 12

Domino Designer Welcome Screen 13

Domino Designer Perspective 14

Creating a New Application 15

Creating an XPage 16

Previewing in the Notes Client 18

Previewing in a Web Browser 18

Adding a Control to an XPage 21

Conclusion 22

Chapter 3 Building Your First XPages Application 23

Laying the Foundations 24

Forms and Views 26

Building an XPages View 31

Completing the CRUD 36

Conclusion 42

Part II: XPages Development: First Principles 43

Chapter 4 Anatomy of an XPage 45

What Exactly Is an XPage? 46

Understanding XSP Tag Markup 47

Getting Started with XML 47

XPages XML Syntax 50

Simple Properties 52

Complex Properties 54

Complex Values 54

Computed Properties 55

Data Binding 59

XPages Tags 60

Data Sources 61

Domino Document 61

Domino View 62

Data Context 63

Controls 64

Editing Controls 64

Command Controls 70

Selection Controls 74

Display Controls 82

File-Handling Controls 84

Containers 87

Panel 87

Table 90

View 91

Data Table 94

Repeat 95

Include Page 99

Tabbed Panel 99

Section 100

XPage Resources 101

Script Library 101

Style Sheet 103

Resource Bundle 104

Dojo Module 105

Generic Head Resource 106

Metadata Resource 106

Converters 107

Validators 110

Simple Actions 118

Client-Side Scripting 125

HTML Tags 127

Conclusion 128

Chapter 5 XPages and JavaServer Faces 129

What Is JavaServer Faces? 130

JSF Primer 131

How Does XPages Extend JSF? 138

XML-Based Presentation Tier 141

Request Processing Lifecycle 142

User Interface Component Model 143

Standard User-Interface Components 148

Value Binding and Method Binding Expression Evaluation 152

XPages Default Variables 154

Conclusion 156

Chapter 6 Building XPages Business Logic 157

Adding Business Logic 157

Using the xp:eventHandler Tag 160

Simple Actions 167

Change Document Mode 168

Confirm Action 169

Create Response Document 170

Delete Document 171

Delete Selected Documents 172

Execute Client Script 173

Execute Script 173

Modify Field 174

Open Page 175

Publish Component Property 176

Publish View Column 177

Save Data Sources 179

Save Document 180

Set Component Mode 182

Set Value 183

Action Group 184

Using JavaScript with XPages 186

Server-Side JavaScript 186

Client JavaScript 206

Conclusion 211

Part III: Data Binding 213

Chapter 7 Working with Domino Documents 215

Domino Document Data Source 216

Creating and Editing Documents 219

Controlling URL Parameter Usage 220

Creating Response Documents 220

Executing Form Logic 224

Managing Concurrent Document Updates 227

Multiple Document Data Sources 228

Document Data Source Events 231

Common Data Source Properties 233

Miscellaneous Data Source Properties 234

Working with Domino Documents–Programmatically! 235

Simple Actions 235

JavaScript 236

Rich Documents 238

Conclusion 242

Chapter 8 Working with Domino Views 243

databaseName Property 245

View Data Source Filters 246

categoryFilter Property 246

search, searchMaxDocs Properties 249

parentId Property 251

ignoreRequestParams Property 252

keys, keysExactMatch Properties 253

Other View Content Modifiers 256

startKeys Property 256

expandLevel Property 257

A Page with Two Views 259

requestParamPrefix Property 260

When Is a View Not a View? 261

Go Fetch! Or Maybe Not... 262

loaded, scope Properties 263

postOpenView, queryOpenView Properties 263

Caching View Data 265

Sorting Columns 270

Conclusion 271

Chapter 9 Beyond the View Basics 273

Pick a View Control, Any View Control 273

The View Control: Up Close and Personal 276

Column Data Like You’ve Never Seen Before 277

Simple View Panel Make Over 279

Working with Categories 293

View Properties and View Panel Properties 301

Data Table 305

Building a Mini Embedded Profile View using a Data Table 311

Repeat Control 316

A Repeat Control Design Pattern 317

Nested Repeats 318

The Rich Get Richer 320

Some Fun with the Pager 321

Conclusion 324

Part IV: Programmability 325

Chapter 10 Custom Controls 327

Divide and Conquer 328

Getting Started with Custom Controls 329

Using Property Definitions 337

Property Tab 340

Validation Tab 343

Visible Tab 345

Property Definitions Summary 346

Using the compositeData Object 346

Send and You Shall Receive 352

Multiple Instances and Property Groups 355

Custom Control Design Patterns 357

Aggregate Container Pattern 357

Layout Container Pattern 358

Conclusion 365

Chapter 11 Advanced Scripting 367

Application Frameworks 367

AJAX and Partial Refresh 369

Partial Refresh: Out-of-the-Box Style! 369

Partial Refresh: Doing-It-My-Way Style! 376

Event Parameters 384

Dojo Integration 386

dojoTheme and dojoParseOnLoad Properties 387

dojoModule Resource 388

dojoType and dojoAttributes Properties 389

Integrating Dojo Widgets and Extending the Dojo Class Path 390

Working with Traditional Notes/Domino Building Blocks 401

Working with @Functions, @Commands, and Formula Language 402

Working with Agents, In-Memory Documents, and Profile Documents 405

Managed Beans 412

Conclusion 419

Chapter 12 XPages Extensibility 421

How to Create a New User Interface Control 422

Example Component 423

Let’s Get Started 424

Create the Initial Application 424

Add Package Explorer to the Domino Designer Perspective 424

Add a Java Source Code Folder 426

Building a Component 428

Create a UI Component Extension Class 428

Create Tag Specificaton (.xsp-config) for the UI Component Extension 431

Create a Renderer and Register It in the Application Configuration (faces-config.xml) 434

Quick Test Application to Verify Everything Is OK So Far 437

Working with Component Properties 438

Component Properties and Attributes 438

Adding a Property to a Component 439

State Holder: Saving State Between Requests 440

Specifying Simple Properties 440

Inheriting xsp-config Properties 441

Create the Initial xsp-config Definitions 446

Create base.xsp-config 446

Create an Interface to Match the Group Property Definition in base.xsp-config 450

Revisit the Component Properties in Domino Designer 452

Specifying Complex Properties 453

Complete the xsp-config for the UISpinner Component 464

Complete the UI Component Extension, UISpinner 473

Complete the Renderer UISpinnerRenderer 477

Create a Sample Application Using the UISpinner Component 483

Take Your New UI Component Extension for a Test Drive 483

Create a Backing Bean 483

Register the Backing Bean 486

Create the Final Test Application 486

Nice Look and Feel 491

Test to Ensure That It All Works! 491

Where to Go From Here 491

XPages Extensibility API Developers Guide 492

XPages Extension Library 492

IBM developerWorks 492

Conclusion 493

Chapter 13 XPages in the Notes Client 495

Think Inside the Box 496

Getting Started with XPages in the Notes Client 498

3, 2, 1...Lift Off 499

Bookmarks 501

Working Offline 503

One of These Things Is Not Like the Other 507

Other Subtle Differences 508

XPages: A Good Notes Citizen 511

Introducing enableModifiedFlag and disableModifiedFlag 513

Keeping Tabs on Your Client Apps 516

Notes Links Versus Domino Links 520

Some Debugging Tips 525

XPages and Composite Applications 528

Making a Component of an XPages Application 529

Is Anyone Out There? Creating a Component that Listens to Your XPages Component 531

Assembling a Composite Application: Aggregating the XPages Discussion Component and Notes Google Widget 533

Hey, This Is a Two-Way Street! A Component May Receive and Publish Events! 536

Further Adventures with Composite Applications 540

Part V: Application User Experience 541

Chapter 14 XPages Theming 543

It Used to Be Like That...But Not Anymore! 543

Styling with Style! 545

Setting the Style Property Manually 550

Understanding How the Style Property Is Used 551

Computing the Style Property 552

Styling with Class! 552

Getting Something for Nothing! 553

Understanding How the styleClass Property Is Used 559

Computing the styleClass Property 561

Working with Extended styleClass and style Properties 563

Theming on Steroids! 567

What Is a Theme? 567

What Can You Do with a Theme? 568

Understanding Theme Architecture and Inheritance 569

Working with a Theme 576

Theme Resources 587

Resource Paths 597

Theme Properties, themeId, Control Definitions, and Control Properties 606

Conclusion 620

Chapter 15 Internationalization 621

Using Localization Options 622

Localization with Resource Bundle Files 623

Setting Localization Options 624

Testing a Localized Application 626

Working with Translators 628

Merging XPage Changes 631

Gotchas! 633

Localizing Computed Expressions and JavaScript 636

Adding a Resource Bundle 637

Localizing Computed Expressions 638

Localizing Client-Side JavaScript 639

Localizing Script Libraries 640

Server-Side Script Libraries 640

Client-Side Script Libraries 641

International Enablement 643

Locales in XPages 644

Deprecated Locale Codes 648

Conclusion 650

Part VI: Performance, Scalability, and Security 651

Chapter 16 Application Performance and Scalability 653

Golden Rules 654

Understanding the Request Processing Lifecycle 655

GET-Based Requests and the JSF Lifecycle 656

POST-Based Requests and the JSF Lifecycle 656

Reducing CPU Utilization 658

GET- Versus POST-Based Requests 658

Partial Refresh 663

Partial Execution Mode 665

Reducing Memory Utilization 668

HTTPJVMMaxHeapSize and HTTPJVMMaxHeapSizeSet Parameters 669

xsp.persistence.* Properties 669

dataCache Property 670

Conclusion 672

Chapter 17 Security 673

Notes/Domino Security and XPages 673

Server Layer of Security 674

Application Layer of Security 675

Design Element Layer of Security 677

Document Layer of Security 684

Workstation ECL Layer of Security 686

Useful Resources 687

Let’s Get Started 687

Creating the Initial Application 687

Implementing ACLs 689

Sign the XPages with Your Signature 690

Programmability Restrictions 691

Sign or Run Unrestricted Methods and Operations 692

Sign Agents to Run on Behalf of Someone Else 692

Sign Agents or XPages to Run on Behalf of the Invoker 693

Sign Script Libraries to Run on Behalf of Someone Else 693

Restricted Operation 693

XPages Security Checking 695

NSF ClassLoader Bridge 695

XPages Security in the Notes Client 696

Execution Control List (ECL) 697

Active Content Filtering 699

Public Access 702

Setting Public Access for XPages 703

Checking for Public Access in XPages 703

SessionAsSigner 704

Troubleshooting XPages Java Security Exceptions 706

Conclusion 707

Part VII: Appendixes 709

Appendix A XSP Programming Reference 711

XSP Tag Reference 711

XSP Java Classes 712

Notes/Domino Java API Classes 714

XSP JavaScript Pseudo Classes 715

Appendix B XSP Style Class Reference 719

XSP CSS Files 719

XSP Style Classes 720

Appendix C Useful XPages Sites on the Net 727

Index 729


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020