Fork me on GitHub

Web context: (v5.5)

1) WebContext

The WebContext is an abstraction to deal with the HTTP request and response of any framework.

It is used to work with:

Its implementations are different depending on the pac4j implementations.

For example, there is a JEEContext for JEE applications, a PlayWebContext for Play applications, etc.

2) WebContextFactory

For a given framework/pac4j implementation, generally, the same type of web context is instantiated over and over again. Though, there are edge cases when you want to instantiate another WebContext.

This is controlled by the WebContextFactory.

Like the WebContext, its implementations are different depending on the pac4j implementations.

For example, there is a JEEContextFactory.INSTANCE to instantiate JEEContext for JEE applications.