Class AppControllerFilter
java.lang.Object
org.javalite.activeweb.HttpSupport
org.javalite.activeweb.controller_filters.HttpSupportFilter
org.javalite.activeweb.controller_filters.AppControllerFilter
- All Implemented Interfaces:
RequestAccess
- Direct Known Subclasses:
DBConnectionFilter
Controller filters are similar to that of Servlet filters, but designed to wrap execution of controllers.
They can be used for many tasks that need to trigger before and after execution of a controller, such as login in, logging,
opening a DB connection, timing, etc.
Instances of filters are not thread safe.
The same object will be reused across many threads at the same time. Create instance variables at your own peril.
Many use cases for controller filters:
- catch all exceptions and respond with a canned error (page)
- check if uses logged in, and redirect to a login page is not
- Author:
- igor on 6/26/17.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.javalite.activeweb.HttpSupport
HttpSupport.HttpBuilder, HttpSupport.RenderBuilder
-
Field Summary
Fields inherited from interface org.javalite.activeweb.RequestAccess
LOGGER
-
Constructor Summary
-
Method Summary
Methods inherited from class org.javalite.activeweb.controller_filters.HttpSupportFilter
after, before, onException
Methods inherited from class org.javalite.activeweb.HttpSupport
applicationJSON, assign, blank, encoding, flash, flash, flash, flash, getEncoding, getFile, getHttpServletRequest, getHttpServletResponse, getMap, getMap, getRealPath, getRequestBytes, getRequestInputStream, getRequestStream, getRequestString, getResponseHeaders, header, header, jsonList, jsonMap, jsonMaps, locale, logDebug, logError, logError, logError, logInfo, logWarning, logWarning, merge, multipartForm, multipartForm, multipartFormItems, multipartFormItems, multipartFormItems, outputStream, outputStream, outputStream, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirectToReferrer, redirectToReferrer, render, respond, sanitize, sendCookie, sendCookie, sendFile, sendFile, sendPermanentCookie, session, session, sessionBoolean, sessionDouble, sessionFloat, sessionHas, sessionInteger, sessionLong, sessionObject, sessionString, setContentLength, setEncoding, setLocale, setRequestEncoding, setResponseEncoding, status, streamOut, uploadedFiles, uploadedFiles, uploadedFiles, values, view, view, view, writer, writer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.javalite.activeweb.RequestAccess
appContext, context, cookie, cookies, cookieValue, exists, format, getId, getLocale, getRequestHost, getRequestPort, getRequestProperties, getRequestProtocol, getRoute, header, headers, host, ipAddress, ipForwardedFor, isDelete, isGet, isHead, isMethod, isMultipartContent, isPost, isPut, isXhr, locale, method, param, param, params, params, params, params1st, params1st, path, port, protocol, queryString, remoteAddress, remoteHost, requestHas, servletPath, session, session, uri, url, userAgent, xhr
-
Constructor Details
-
AppControllerFilter
public AppControllerFilter()
-