|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.io.IOException org.norther.tammi.core.base.LogException org.norther.tammi.spray.filter.DefaultExceptionFilter org.norther.tammi.spray.terminal.TerminalExceptionFilter org.norther.tammi.spray.engine.DefaultTemplateExceptionFilter
public class DefaultTemplateExceptionFilter
A default implementation of TemplateExceptionFilter.
Note that negative status code prevents logging.
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<? extends Throwable> clazz,
String template)
Adds a default template for the specified exception class if not present. |
protected void |
commitMessage(ServletRequest request,
ServletResponse response,
FilterChain chain)
Commits a message. |
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. |
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 |
---|
commitMessage, destroy, doFilter, getMBeanServer, getObjectName, getStatusCode, init, isRegistered, postmanaged, premanaged, unmanaged |
Methods inherited from class org.norther.tammi.core.base.LogException |
---|
equals, getArgument, getLevel, getLocalizedMessage, getLocalizedMessage, getMessageLog, getTime, hashCode, 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, finalize, getClass, 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<? extends Throwable> clazz, String template)
clazz
- the exception class.template
- the default template.public String getErrorTemplate()
TemplateExceptionFilter
getErrorTemplate
in interface TemplateExceptionFilter
public void setErrorTemplate(String template)
TemplateExceptionFilter
setErrorTemplate
in interface TemplateExceptionFilter
template
- the error template.public String getDefaultTemplate()
TemplateExceptionFilter
getDefaultTemplate
in interface TemplateExceptionFilter
public String getDefaultTemplate(String className)
TemplateExceptionFilter
getDefaultTemplate
in interface TemplateExceptionFilter
className
- the exception class name.
public void setDefaultTemplate(String className, String template)
TemplateExceptionFilter
setDefaultTemplate
in interface TemplateExceptionFilter
className
- the exception class name.template
- the default template.protected void commitMessage(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException
DefaultExceptionFilter
commitMessage
in class TerminalExceptionFilter
request
- the request.response
- the response.chain
- the filter chain.
IOException
- on I/O errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |