|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.io.IOException
org.norther.tammi.core.base.LogException
org.norther.tammi.spray.filter.DefaultExceptionFilter
org.norther.tammi.spray.engine.DefaultTemplateExceptionFilter
public class DefaultTemplateExceptionFilter
A default implementation of TemplateExceptionFilter.
Note that negative status code prevents logging.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.LogException |
|---|
DEFAULT, ERROR, FATAL, INFO, NONE, WARN, WARNING |
| Constructor Summary | |
|---|---|
DefaultTemplateExceptionFilter(int code)
Constructs an exception with a code. |
|
DefaultTemplateExceptionFilter(int code,
String argument)
Constructs an exception with a code and argument. |
|
DefaultTemplateExceptionFilter(int code,
String argument,
Throwable reason)
Constructs an exception with a code, argument and reason. |
|
DefaultTemplateExceptionFilter(int code,
Throwable reason)
Constructs an exception with a code and reason. |
|
DefaultTemplateExceptionFilter(String template,
int code)
Constructs an exception with a template and code. |
|
DefaultTemplateExceptionFilter(String template,
int code,
String argument)
Constructs an exception with a template, code and argument. |
|
DefaultTemplateExceptionFilter(String template,
int code,
String argument,
Throwable reason)
Constructs an exception with a template, code, argument and reason. |
|
DefaultTemplateExceptionFilter(String template,
int code,
Throwable reason)
Constructs an exception with a template, code and reason. |
|
| Method Summary | |
|---|---|
protected static void |
addDefaultTemplate(Class clazz,
String template)
Adds a default template for the specified exception class if not present. |
String |
getDefaultTemplate()
Gets the default template for this exception class. |
String |
getDefaultTemplate(String className)
Gets the default template for the named exception class. |
String |
getErrorTemplate()
Gets the error template. |
protected CharSequence |
getMessage(ServletRequest request,
ServletResponse response,
FilterChain chain)
Returns the message to produce. |
void |
setDefaultTemplate(String className,
String template)
Sets the default template for the names exception class. |
void |
setErrorTemplate(String template)
Sets the error template. |
| Methods inherited from class org.norther.tammi.spray.filter.DefaultExceptionFilter |
|---|
destroy, doFilter, getMBeanServer, getObjectName, getStatusCode, init, isRegistered, postmanaged, premanaged, prepareCommit, unmanaged |
| Methods inherited from class org.norther.tammi.core.base.LogException |
|---|
getArgument, getLevel, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessageLog, getTime, setLevel |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.spray.filter.ExceptionFilter |
|---|
getLocalizedMessage, getMessage, getStatusCode |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, doFilter, init |
| Constructor Detail |
|---|
public DefaultTemplateExceptionFilter(int code)
code - a status code.
public DefaultTemplateExceptionFilter(int code,
String argument)
code - a status code.argument - an argument string.
public DefaultTemplateExceptionFilter(int code,
Throwable reason)
code - a status code.reason - a reason throwable.
public DefaultTemplateExceptionFilter(int code,
String argument,
Throwable reason)
code - a status code.argument - an argument string.reason - a reason throwable.
public DefaultTemplateExceptionFilter(String template,
int code)
template - the actual template.code - a status code.
public DefaultTemplateExceptionFilter(String template,
int code,
String argument)
template - the actual template.code - a status code.argument - an argument string.
public DefaultTemplateExceptionFilter(String template,
int code,
Throwable reason)
template - the actual template.code - a status code.reason - a reason throwable.
public DefaultTemplateExceptionFilter(String template,
int code,
String argument,
Throwable reason)
template - the actual template.code - a status code.argument - an argument string.reason - a reason throwable.| Method Detail |
|---|
protected static void addDefaultTemplate(Class clazz,
String template)
clazz - the exception class.template - the default template.public String getErrorTemplate()
TemplateExceptionFilter
getErrorTemplate in interface TemplateExceptionFilterpublic void setErrorTemplate(String template)
TemplateExceptionFilter
setErrorTemplate in interface TemplateExceptionFiltertemplate - the error template.public String getDefaultTemplate()
TemplateExceptionFilter
getDefaultTemplate in interface TemplateExceptionFilterpublic String getDefaultTemplate(String className)
TemplateExceptionFilter
getDefaultTemplate in interface TemplateExceptionFilterclassName - the exception class name.
public void setDefaultTemplate(String className,
String template)
TemplateExceptionFilter
setDefaultTemplate in interface TemplateExceptionFilterclassName - the exception class name.template - the default template.
protected CharSequence getMessage(ServletRequest request,
ServletResponse response,
FilterChain chain)
DefaultExceptionFilter
getMessage in class DefaultExceptionFilterrequest - the request.response - the response.chain - the filter chain.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||