Class SystemPageRenderer


  • public class SystemPageRenderer
    extends Object
    Renderer which renders static pages like error messages and writes them on an output stream.
    Author:
    A. Pragt, T. Middeldorp
    • Constructor Detail

      • SystemPageRenderer

        public SystemPageRenderer​(com.aquima.interactions.foundation.io.IResourceManager resourceManager,
                                  String webResourcePath)
    • Method Detail

      • renderLogin

        public void renderLogin​(Writer target)
                         throws Exception
        Equivalent of {@link #renderLogin(Writer, boolean), with no login error message}
        Throws:
        Exception
      • renderLogin

        public void renderLogin​(Writer target,
                                boolean loginError)
                         throws Exception
        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

        public void renderLogout​(Writer target)
                          throws Exception
        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.
      • renderException

        public int renderException​(Writer target,
                                   Exception ex)
                            throws Exception
        Renders a caught exception as HTML, using the specified stream writer. Stacktrace is not shown by default.
        Parameters:
        target - The stream writer to write the rendered exception to.
        ex - The exception to render.
        Returns:
        HTTP status code
        Throws:
        Exception - When an exception occurs during rendering.