public abstract class AppController extends HttpSupport
HttpSupport.HttpBuilder, HttpSupport.RenderBuilder
Constructor and Description |
---|
AppController() |
Modifier and Type | Method and Description |
---|---|
boolean |
actionSupportsHttpMethod(String actionMethodName,
HttpMethod httpMethod)
Checks if the action supports an HTTP method, according to its configuration.
|
protected List<HttpMethod> |
allowedActions(String actionMethodName) |
protected String |
getContentType()
Returns hardcoded value "text/html".
|
protected String |
getLayout()
Returns a name for a default layout as provided in
activeweb_defaults.properties file. |
protected String |
queryString()
Returns query string of the request.
|
protected HttpSupport.RenderBuilder |
render()
Use this method in order to override a layout, status code, and content type.
|
protected HttpSupport.RenderBuilder |
render(String template)
Renders results with a template.
|
boolean |
restful()
Returns true if this controller is configured to be
RESTful . |
static <T extends AppController> |
restful(Class<T> controllerClass) |
protected String |
servletPath() |
protected boolean |
standardActionSupportsHttpMethod(String actionMethodName,
HttpMethod httpMethod) |
appContext, assign, blank, context, cookie, cookies, cookieValue, encoding, exists, flash, flash, flash, flash, format, getEncoding, getFile, getHttpServletRequest, getHttpServletResponse, getId, getLocale, getMap, getMap, getRealPath, getRequestBytes, getRequestHost, getRequestInputStream, getRequestPort, getRequestProtocol, getRequestStream, getRequestString, getResponseHeaders, getRoute, header, header, header, headers, host, ipAddress, ipForwardedFor, isDelete, isGet, isHead, isPost, isPut, isXhr, jsonList, jsonMap, jsonMaps, locale, locale, logDebug, logError, logError, logError, logInfo, logWarning, logWarning, merge, method, multipartFormItems, multipartFormItems, multipartFormItems, outputStream, outputStream, outputStream, param, param, params, params, params, params1st, params1st, path, port, protocol, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirectToReferrer, redirectToReferrer, remoteAddress, remoteHost, render, requestHas, respond, sanitize, sendCookie, sendCookie, sendFile, sendFile, sendPermanentCookie, session, session, session, sessionBoolean, sessionDouble, sessionFloat, sessionHas, sessionInteger, sessionLong, sessionObject, sessionString, setContentLength, setEncoding, setLocale, setRequestEncoding, setResponseEncoding, status, streamOut, uploadedFiles, uploadedFiles, uploadedFiles, uri, url, userAgent, values, view, view, view, writer, writer, xhr
protected HttpSupport.RenderBuilder render(String template)
IllegalStateException
.template
- - template name, can be "list" - for a view whose name is different than the name of this action, or
"/another_controller/any_view" - this is a reference to a view from another controller. The format of this
parameter should be either a single word or two words separated by slash: '/'. If this is a single word, than
it is assumed that template belongs to current controller, if there is a slash used as a separator, then the
first word is assumed to be a name of another controller.RenderBuilder
, which is used to provide additional parameters.protected HttpSupport.RenderBuilder render()
RenderBuilder
, which is used to provide additional parameters.protected String servletPath()
protected String queryString()
HttpSupport
queryString
in class HttpSupport
protected String getLayout()
activeweb_defaults.properties
file.
Override this method in a sub-class. Value expected is a fully qualified name of a layout template.
Example: "/custom/custom_layout"
protected String getContentType()
public boolean actionSupportsHttpMethod(String actionMethodName, HttpMethod httpMethod)
actionMethodName
- name of action method.httpMethod
- http methodprotected boolean standardActionSupportsHttpMethod(String actionMethodName, HttpMethod httpMethod)
protected List<HttpMethod> allowedActions(String actionMethodName)
public boolean restful()
RESTful
.public static <T extends AppController> boolean restful(Class<T> controllerClass)
Copyright © 2019 JavaLite. All rights reserved.