public class Configuration extends Object
Constructor and Description |
---|
Configuration() |
Modifier and Type | Method and Description |
---|---|
static boolean |
activeReload() |
static String |
get(String name) |
static String |
getBootstrapClassName() |
static String |
getControllerConfigClassName() |
static String |
getDbConfigClassName() |
static String |
getDefaultLayout() |
static String |
getEnv()
Returns name of environment, such as "development", "production", etc.
|
protected static List<HttpSupportFilter> |
getFilters() |
static AbstractFreeMarkerConfig |
getFreeMarkerConfig() |
protected static List<String> |
getLogHeaders() |
static int |
getMaxUploadSize() |
static String |
getRootPackage() |
static String |
getRouteConfigClassName() |
static String |
getTargetDir() |
static TemplateManager |
getTemplateManager() |
static File |
getTmpDir() |
protected static void |
injectFilters() |
static boolean |
isTesting()
This method is used internally by ActiveWeb tests.
|
static void |
logHeaders(String... headerNames)
Provide names of headers to log to the log system with each request.
|
static boolean |
logRequestParams() |
static boolean |
rollback() |
static boolean |
runningIn(String environment)
Returns true if the environment is the same as argument.
|
protected static void |
setEnv(String env) |
protected static void |
setFilters(List<HttpSupportFilter> allFilters) |
protected static void |
setTesting(boolean testing) |
static void |
setUseDefaultLayoutForErrors(boolean useDefaultLayoutForErrors)
Set to true if you want ActiveWeb to wrap the errors, such as 404, and 500 in a default layout.
|
protected static boolean |
useDefaultLayoutForErrors()
True to use default layout for error pages, false not to.
|
public static void setUseDefaultLayoutForErrors(boolean useDefaultLayoutForErrors)
package app.controllers; import org.javalite.activeweb.controller_filters.HttpSupportFilter; import static org.javalite.common.Collections.map; public class CatchAllFilter extends HttpSupportFilter { public void onException(Exception e) { render("/system/error", map("message", e.getMessage())).layout("error_layout"); } }This way you have a complete control over how your error messages are displayed.
useDefaultLayoutForErrors
- true to use default layout, false no not to use it.protected static boolean useDefaultLayoutForErrors()
public static boolean logRequestParams()
public static boolean runningIn(String environment)
environment
- name of environment in question.ACTIVE_ENV
, false if not.public static String getEnv()
ACTIVE_ENV
.protected static void setEnv(String env)
public static boolean isTesting()
protected static void setTesting(boolean testing)
public static AbstractFreeMarkerConfig getFreeMarkerConfig()
public static TemplateManager getTemplateManager()
public static String getDefaultLayout()
public static String getBootstrapClassName()
public static String getControllerConfigClassName()
public static String getDbConfigClassName()
public static String getRouteConfigClassName()
public static String getTargetDir()
public static String getRootPackage()
public static boolean rollback()
public static boolean activeReload()
public static int getMaxUploadSize()
public static File getTmpDir()
protected static void setFilters(List<HttpSupportFilter> allFilters)
protected static List<HttpSupportFilter> getFilters()
protected static void injectFilters()
public static void logHeaders(String... headerNames)
headerNames
- list of headers to log. If the first argument is '*', all headers will be logged.Copyright © 2019 JavaLite. All rights reserved.