Tobago Demo

Menu

Root Dummy Intro Search Getting Started Docker What's New Migration Compatibility FAQ API Download Server Info Logging Info In Suggest Textarea Date Range Group 5 Star Rating File Upload Out Label Badge Image Figure Progress Object Checkbox Toggle Dropdown Radio Listbox SelectOneList Multi Checkbox Multi Listbox Shuttle SelectManyList Button and Link Default Command Button Group Customizer Link Group Box Panel Separator Section Header and Footer Bar Popup Popover Toast Basic example Tab Client Tab Ajax Tab Server Basic example Sheet Sorting Paginator Sheet Column Selector Sheet Selectionchange Sheet Event Sheet Action Sheet Markup Sheet Style Empty Sheet Column Bar Sheet Filter Sheet Static Header Sheet Multi Header Sheet Tree Column Panel Sheet Editable Sheet Lazy Sheet Nested Basic example Tree Command Types Tree Select Tree Editor Tree Menu Tree Listbox Intro TinyMCE CKEditor Flow Layout Flex Layout Segment Layout Label Layout Grid Layout Split Layout Message-layout Overview Collapsible Box Collapsible Popup Collapsible Panel Collapsible Section Content Validation JSR 303 Severity Messages Content Security Policy Sanitize Roles Form AccessKey Focus Exception Handler Style Tag Bootstrap Theme Icons Partial Ajax Behavior WebSocket Transition Non Faces Request Conversion Error Handling For Each ConversationScoped Download Configuration Format Locale DataAttribute Meta
Root Dummy Intro Search Getting Started Docker What's New Migration Compatibility FAQ API Download Server Info Logging Info In Suggest Textarea Date Range Group 5 Star Rating File Upload Out Label Badge Image Figure Progress Object Checkbox Toggle Dropdown Radio Listbox SelectOneList Multi Checkbox Multi Listbox Shuttle SelectManyList Button and Link Default Command Button Group Customizer Link Group Box Panel Separator Section Header and Footer Bar Popup Popover Toast Basic example Tab Client Tab Ajax Tab Server Basic example Sheet Sorting Paginator Sheet Column Selector Sheet Selectionchange Sheet Event Sheet Action Sheet Markup Sheet Style Empty Sheet Column Bar Sheet Filter Sheet Static Header Sheet Multi Header Sheet Tree Column Panel Sheet Editable Sheet Lazy Sheet Nested Basic example Tree Command Types Tree Select Tree Editor Tree Menu Tree Listbox Intro TinyMCE CKEditor Flow Layout Flex Layout Segment Layout Label Layout Grid Layout Split Layout Message-layout Overview Collapsible Box Collapsible Popup Collapsible Panel Collapsible Section Content Validation JSR 303 Severity Messages Content Security Policy Sanitize Roles Form AccessKey Focus Exception Handler Style Tag Bootstrap Theme Icons Partial Ajax Behavior WebSocket Transition Non Faces Request Conversion Error Handling For Each ConversationScoped Download Configuration Format Locale DataAttribute Meta

Exception Handler

Since Tobago 4.0.0 an AjaxExceptionHandler takes care of exceptions in ajax case.

Important! The exception has to be thrown before the renderer phase. This is the case, in normal actions, but if you need e.g. some initialization of data in a page, you can achieve that with an <f:event type="preRenderView" listener="#{bean.doSomeCriticalWork}"/>.

The AjaxExceptionHandler take the first exception that occurs and try to find a proper error page. Error pages are defined in the web.xml.

If no proper error page could be found, the error page for error code 500 is displayed instead. If no 500-error-page is defined, the general error page (no exceptiontype or error code defined) is used.

If there is no ajax case, the error page could not be found or the renderer phase is active, the AjaxExceptionHandler do nothing and let JSF handle the exception.

Example One

The output field is updated after a change event of the input field.

Set the input value to 'x' to throw an exception.

Example Two

This example use the <f:event type="preRenderView"/> tag.

An exceptions is thrown after page 7 or higher is selected.

Name Orbit Period (Days) Discoverer Year
Sun - 0.0 -
Mercury Sun 87.97 -
Venus Sun 224.7 -
Earth Sun 365.26 -
Rows 1 to 4 of 88
  • Page 1 of 22
© 2005-2025 Apache Software Foundation, Licensed under the Apache License, Version 2.0.