JBoss.orgCommunity Documentation

Errai Reference Guide


1. Introduction
1.1. What is it?
1.2. Required software
1.3. Getting Started with Errai
1.3.1. Technology Primer
1.3.2. Creating your first project
1.3.3. Running and Debugging with GWT’s Super Dev mode
1.3.4. Running and Debugging in Eclipse using Maven tooling
1.3.5. Running and Debugging in your IDE using GWT tooling
1.3.6. A Gentle Introduction to CDI
2. Messaging
2.1. Messaging Overview
2.2. Messaging API Basics
2.2.1. Sending Messages with the Client Bus
2.2.2. Receiving Messages on the Server Bus / Server Services
2.2.3. Sending Messages with the Server Bus
2.2.4. Receiving Messages on the Client Bus/ Client Services
2.2.5. Local Services
2.3. Single-Response Conversations & Pseudo-Synchronous Messaging
2.4. Sender Inferred Subjects
2.5. Broadcasting
2.6. Client-to-Client Communication
2.6.1. Relay Services
2.7. Message Routing Information
2.8. Handling Errors
2.8.1. Handling global message transport errors
2.9. Asynchronous Message Tasks
2.10. Repeating Tasks
2.11. Queue Sessions
2.11.1. Lifecycle
2.11.2. Scopes
2.12. Wire Protocol (J.REP)
2.12.1. Payload Structure
2.12.2. Message Routing
2.12.3. Bus Management and Handshaking Protocols
2.13. Conversations
2.14. WebSockets
2.14.1. Configuring the sideband server
2.14.2. Deploying with JBoss AS 7.1.2 (or higher)
2.14.3. JSR-356 WebSocket support (Deploying to WildFly 8.0 or higher)
2.14.4. WebSocket Security
2.15. Bus Lifecycle
2.15.1. Turning Server Communication On and Off
2.15.2. Observing Bus Lifecycle State and Communication Status
2.16. Shadow Services
2.17. Debugging Messaging Problems
3. Dependency Injection
3.1. Container Wiring
3.2. Wiring server side components
3.3. Scopes
3.3.1. Dependent Scope
3.4. Built-in Extensions
3.4.1. Bus Services
3.4.2. Client Components
3.4.3. Global Exception Handling
3.4.4. Lifecycle Tools
3.4.5. Timed Methods
3.5. Client-Side Bean Manager
3.5.1. Looking up beans
3.5.2. Availability of beans
3.6. Alternatives
3.7. Bean Lifecycle
3.7.1. Destruction of Beans
4. Errai CDI
4.1. Features and Limitations
4.1.1. Other features
4.2. Events
4.2.1. Conversational events
4.2.2. Local Events
4.2.3. Client-Server Event Example
4.3. Producers
4.4. Safe dynamic lookup
4.5. Deploying Errai CDI
5. Marshalling
5.1. Mapping Your Domain
5.1.1. @Portable and @NonPortable
5.1.2. Manual Mapping
5.1.3. Manual Class Mapping
5.1.4. Custom Marshallers
6. Remote Procedure Calls (RPC)
6.1. Creating an RPC Interface
6.2. Making calls
6.2.1. Proxy Injection
6.3. Handling exceptions
6.3.1. Global RPC exception handler
6.4. Client-side Interceptors
6.4.1. Annotating the Remote Interface
6.4.2. Implementing an Interceptor
6.4.3. Annotating the Interceptor (alternative)
6.4.4. Interceptors and IOC
6.5. Session and request objects in RPC endpoints
6.6. Batching remote calls
6.7. Asynchronous handling of RPCs on the server
7. Errai JAX-RS
7.1. Server-Side JAX-RS Implementation
7.2. Shared JAX-RS Interface
7.3. Creating Requests
7.3.1. Proxy Injection
7.4. Handling Responses
7.4.1. Handling Errors
7.5. Accesssing and aborting requests
7.6. Client-side Interceptors
7.6.1. Annotating the JAX-RS Interface
7.6.2. Implementing an Interceptor
7.6.3. Annotating the Interceptor (alternative)
7.6.4. Interceptors and IOC
7.7. Wire Format
7.8. Path
8. Errai JPA
8.1. Getting Started
8.1.1. META-INF/persistence.xml
8.1.2. Declaring an Entity Class
8.1.3. Entity Lifecycle States
8.1.4. Obtaining an instance of EntityManager
8.1.5. Named Queries
8.1.6. Entity Lifecycle Events
8.1.7. JPA Metamodel
8.1.8. JPA Features Not Implemented in Errai 2.4
8.1.9. Other Caveats for Errai 2.1 JPA
8.2. Errai JPA Data Sync
8.2.1. How To Use It
9. Data Binding
9.1. Getting Started
9.1.1. Bindable Objects
9.1.2. Initializing a DataBinder
9.2. Creating Bindings
9.3. Specifying Converters
9.3.1. Registering a global default converter
9.3.2. Providing a binding-specific converter
9.4. Property Change Handlers
9.5. Declarative Binding
9.5.1. Default, Simple, and Chained Property Bindings
9.5.2. Data Converters
9.5.3. Updating model values on UI text changes
9.5.4. Replacing a model object
9.6. Bean validation
9.6.1. Excluding Classes from Validation
10. Errai UI
10.1. Get started
10.2. Use Errai UI Components
10.2.1. Parts of an Errai UI component
10.2.2. Using a single component instance
10.2.3. Using multiple instances (for iteration)
10.3. Creating your own component
10.3.1. Basic templated bean
10.3.2. Custom template names
10.3.3. Template providers
10.4. Create an HTML template
10.4.1. Using an HTML fragment as a template
10.4.2. Select a fragment from a larger HTML template
10.5. Adding behaviour to your components
10.5.1. Annotate Elements in the template with @DataField
10.5.2. Allowed DataField types
10.5.3. Accessing the root element of a component
10.5.4. Using JsType element wrappers
10.5.5. Injecting JsTypes and Elements that have multiple tag names
10.5.6. Add corresponding attributes to the HTML template
10.6. How HTML templates are merged with Components
10.6.1. Example
10.6.2. Element attributes (template wins)
10.6.3. DOM Elements (templated bean field wins)
10.6.4. Inner text and inner HTML (preserved when component implements HasText or HasHTML)
10.7. Event handlers
10.7.1. Concepts
10.7.2. JS Interop wrapped events on Elements and Widgets
10.7.3. GWT events on Widgets
10.7.4. GWT events on DOM Elements
10.7.5. Native DOM events on Elements
10.8. HTML Form Support
10.8.1. A Login Form that Triggers Browsers' "Remember Password" Feature
10.8.2. Using the Correct Elements in the Template
10.9. Data Binding
10.9.1. Default, Simple, and Chained Property Bindings
10.9.2. Binding of Lists
10.9.3. Data Converters
10.10. Nest components
10.11. Extend components
10.11.1. Template
10.11.2. Parent component
10.11.3. Child component
10.12. Stylesheet binding
10.12.1. Usage with Data Binding
10.13. Internationalization (i18n)
10.13.1. HTML Template Translation
10.13.2. TranslationKey and TranslationService
10.14. Extended styling with LESS
11. Errai UI Navigation
11.1. Getting Started
11.2. How it Works
11.2.1. Declaring a Page
11.2.2. Page Lifecycle
11.2.3. Page State Parameters
11.2.4. PushState Functionality
11.2.5. Declaring a Link with TransitionAnchor
11.2.6. Declaring a Manual Link
11.2.7. Following a Manual Link
11.2.8. Declaring a Link By UniquePageRole
11.2.9. Installing the Navigation Panel into the User Interface
11.2.10. Overriding the default Navigating Panel type
11.2.11. Handling Navigation Errors
11.2.12. Viewing the Generated Navigation Graph
12. Errai Cordova (Mobile Support)
12.1. Integrate with native hardware
13. Errai Security
13.1. Basic Model
13.2. Getting Started
13.2.1. Making Users
13.2.2. Authentication from the Client
13.3. RestrictedAccess
13.3.1. Simple Roles as Strings
13.3.2. Provided Roles
13.3.3. RPC Services
13.3.4. Page Navigation
13.3.5. Hiding UI Elements
13.4. Form Based Login
13.4.1. Errai User Host Page Filter
13.5. Using an Alternative to PicketLink
13.6. Using Keycloak for Authentication
13.6.1. How It Works (Overview)
13.6.2. Setup
14. Logging
14.1. What is slf4j?
14.2. Client-Side Setup
14.2.1. Errai Client-Side Log Handlers
14.2.2. Configuring Errai Client-Side Log Handlers
14.2.3. Format String
14.3. Server-Side Setup
14.4. Example Usage
14.5. Logger Names
15. Configuration
15.1. Errai Development Mode Configuration
15.1.1. Deployment in Development Mode (JBossLauncher)
15.1.2. Additional JBossLauncher Arguments
15.1.3. Deployment to an Application Server
15.2. Server-Side Class Generation
15.3. Errai Offline Mode Configuration
15.4. ErraiApp.properties
15.4.1. As a Marker File
15.4.2. As a Configuration File
15.5. Messaging (Errai Bus) Configuration
15.5.1. Compile-time Dependencies
15.5.2. Disabling remote communication
15.5.3. Configuring an alternative remote remote bus endpoint
15.5.4. ErraiService.properties
15.5.5. Servlet Configuration
15.6. Errai JAX-RS Setup
15.6.1. Compile-time dependency
15.6.2. GWT Module
15.6.3. Configuration
15.7. Errai JPA
15.7.1. Compile-time Dependencies
15.7.2. GWT Module Descriptor
15.8. Errai JPA Data Sync
15.8.1. Compile-time Dependencies
15.8.2. GWT Module Descriptor
15.9. Errai Data Binding
15.9.1. Compile-time Dependencies
15.9.2. GWT module descriptor
15.9.3. Bootstrapping Data Binding without Errai IOC
15.10. Errai UI
15.10.1. Compile-time dependency
15.10.2. GWT Module Descriptor
15.11. Errai UI Navigation
15.11.1. Compile-time Dependencies
15.11.2. GWT Module Descriptor
15.12. Errai Cordova (Mobile Support)
15.12.1. Compile-time Dependencies
15.12.2. Cordova Maven Plugin
15.12.3. GWT Module Descriptor
15.12.4. Building with Errai Cordova
15.13. Errai Security
15.13.1. Compile-time dependency
15.13.2. GWT Module Descriptor
15.13.3. CDI and Interceptor Bindings
15.14. Errai Project Dependencies
15.14.1. Errai Messaging
15.14.2. Errai CDI
15.14.3. Errai IOC
15.14.4. Errai UI
15.14.5. Errai Navigation
15.14.6. Errai DataBinding
15.14.7. Errai JPA Client
15.14.8. Errai JPA Datasync
15.14.9. Errai JAXRS
15.14.10. Errai Cordova
15.14.11. Errai Security
16. Troubleshooting & FAQ
16.1. Why does it seem that Errai can’t see my class at compile time?
16.2. Why am I getting "java.lang.ClassFormatError: Illegal method name "<init>$" in class org/xyz/package/MyClass"?
16.3. I’m getting "java.lang.RuntimeException: There are no proxy providers registered yet." in my @PostConstruct method!
16.4. Why do I get a "404 - Not Found" page if I try to navigate to my web page by typing in the URL or refreshing the page?
17. Upgrade Guide
17.1. Upgrading from 1.* to 2.0
17.2. Upgrading from 2.0.Beta to 2.0.*.Final
17.3. Upgrading from Errai 2.2.x to 2.4 or 3.0
17.4. Upgrading to Errai 3.0
17.5. Upgrading to Errai 3.1 from 3.0
17.6. Upgrading to Errai 3.2 from 3.1
17.7. Upgrading to Errai 4.0 from 3.2
18. Downloads
19. Sources
20. Reporting problems
21. Errai License