java.lang.Object
com.aoapps.servlet.filter.EncodeURIFilter
- All Implemented Interfaces:
Filter
Encodes the URL to either
RFC 3986 URI US-ASCII format
or RFC 3987 IRI Unicode format.
If the URL begins with
javascript:, cid:, or data:,
(case-insensitive) it is not altered.
Canonical URLs are always encoded to US-ASCII format.
IRI support is disabled by default, and only recommended for development or internal systems. IRI may result in slightly smaller output, and more readable HTML source, but for interoperability should be off in production systems.
RFC 7231 - 7.1.2. Location refers only to RFC 3986 URI for URI-reference, thus redirects are always formatted as RFC 3986 URI.
This should be used for both the DispatcherType.REQUEST and DispatcherType.ERROR dispatchers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(ServletRequest request, ServletResponse response, FilterChain chain) Performs encoding on the given URL in the given response encoding.Deprecated.static EncodeURIFiltergetActiveFilter(ServletRequest request) Gets the filter active on the given request.voidinit(FilterConfig config)
-
Constructor Details
-
EncodeURIFilter
public EncodeURIFilter()
-
-
Method Details
-
getActiveFilter
Gets the filter active on the given request.- Returns:
- The currently active filter or
nullfor none active.
-
init
-
encode
Performs encoding on the given URL in the given response encoding. -
encode
Deprecated.Please provide the currentDoctypeso can be enabled selectively viaDoctype.getSupportsIRI().Performs encoding on the given URL in the given response encoding. -
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException - Specified by:
doFilterin interfaceFilter- Throws:
IOExceptionServletException
-
destroy
public void destroy()
-

Doctypeso can be enabled selectively viaDoctype.getSupportsIRI().