Class Canonical

java.lang.Object
com.aoapps.servlet.http.Canonical
All Implemented Interfaces:
AutoCloseable

public abstract class Canonical extends Object implements AutoCloseable
Coordinates when canonical URLs should be generated during response URL rewriting (such as information added when cookies are disabled). These URLs without per-user settings are used in things like Canonical URLs, BreadcrumbList, and Sitemaps.

This is implemented as a thread local, so the state must be set by the thread that will invoke HttpServletResponse.encodeURL(java.lang.String) (and related methods). Thus, it would be inappropriate to set this in a broad, asynchronous scope where the thread handling the request may change.