Package com.aquima.web.ui
Class SystemPageRenderer
java.lang.Object
com.aquima.web.ui.SystemPageRenderer
Renderer which renders static pages like error messages and writes them on an output stream.
- Author:
- A. Pragt, T. Middeldorp
-
Constructor Summary
ConstructorsConstructorDescriptionSystemPageRenderer
(com.aquima.interactions.foundation.io.IResourceManager resourceManager, String webResourcePath) -
Method Summary
Modifier and TypeMethodDescriptionint
renderException
(Writer target, Exception ex, boolean renderJson, boolean showStacktrace) Renders a caught exception as HTML or JSON, using the specified stream writer.void
renderLogin
(Writer target, boolean loginError) Renders a login page on the specified stream writer.void
renderLogout
(Writer target) Renders a logout page on the specified stream writer.
-
Constructor Details
-
SystemPageRenderer
public SystemPageRenderer(com.aquima.interactions.foundation.io.IResourceManager resourceManager, String webResourcePath)
-
-
Method Details
-
renderLogin
Renders a login page on the specified stream writer.- Parameters:
target
- The writer to render the page on.loginError
- Flag for login error message- Throws:
Exception
- If an exception occurred during rendering of the page.
-
renderLogout
Renders a logout page on the specified stream writer.- Parameters:
target
- The writer to render the page on.- Throws:
Exception
- If an exception occurred during rendering of the page.
-
renderException
public int renderException(Writer target, Exception ex, boolean renderJson, boolean showStacktrace) throws Exception Renders a caught exception as HTML or JSON, using the specified stream writer.- Parameters:
target
- The stream writer to write the rendered exception to.ex
- The exception to render.renderJson
- Determines whether or not to render in JSON, if false an HTML page will be rendered.showStacktrace
- Determines whether to show stacktrace when rendering exception- Returns:
- HTTP status code
- Throws:
Exception
- When an exception occurs during rendering.
-