Built-in scopes

The term built-in scope refers to the scope annotations that are defined by the CDI specification and implemented by Weld for us to use in our applications. They represent the most common scope use cases that are present within web application development in a servlet container. If it didn't provide these scope annotations for us, it would be extremely inefficient and error prone for us to implement our own solutions for these scopes.

The CDI specification defines the following built-in scopes, some of which we've already used in the previous chapters:

  • @RequestScoped
  • @SessionScoped
  • @ApplicationScoped
  • @ConversationScoped

@RequestScoped , @SessionScoped , and @ApplicationScoped are all applicable to any web application that we develop, ...

Get JBoss Weld CDI for Java Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.