com.aoindustries.website.framework
Class HTMLInputStreamPage

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.aoindustries.website.framework.ErrorReportingServlet
              extended by com.aoindustries.website.framework.WebPage
                  extended by com.aoindustries.website.framework.InputStreamPage
                      extended by com.aoindustries.website.framework.HTMLInputStreamPage
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class HTMLInputStreamPage
extends InputStreamPage

Pulls the content from a file with the same name and location as the .class and .java but with a .html extension. As the file is being sent to the client, any href='@classname' URL is rewritten and maintains the current WebSiteRequest parameters.

Author:
AO Industries, Inc.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.aoindustries.website.framework.WebPage
emptyWebPageArray, reHTMLPattern
 
Fields inherited from class com.aoindustries.website.framework.ErrorReportingServlet
BUFFER_SIZE
 
Constructor Summary
HTMLInputStreamPage(LoggerAccessor loggerAccessor)
           
HTMLInputStreamPage(LoggerAccessor loggerAccessor, java.lang.Object param)
           
HTMLInputStreamPage(WebSiteRequest req)
           
 
Method Summary
static java.io.InputStream getHTMLInputStream(java.lang.Class clazz)
          Gets the HTML file with the same name as the provided Class.
 java.io.InputStream getInputStream()
          Gets the file that the text should be read from.
static void printHTML(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, WebPageLayout layout, java.lang.String html, java.lang.String linkClass)
          Prints HTML content, parsing for special @ tags.
static void printHTMLStream(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, WebPageLayout layout, java.io.InputStream in, java.lang.String linkClass)
           
 void printStream(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, java.io.InputStream in)
           
 
Methods inherited from class com.aoindustries.website.framework.InputStreamPage
doGet, printStreamStatic
 
Methods inherited from class com.aoindustries.website.framework.WebPage
canAccess, doGet, doPost, doPost, doPostWithSearch, enforceEncryption, equals, equals, generateURLPath, getAdditionalHeaders, getAuthor, getCachedPages, getClassLastModified, getClassLoaderUptime, getContentVAlign, getCopyright, getDescription, getHTMLChainWriter, getHTMLOutputStream, getJavaScriptSrc, getKeywords, getLastModified, getLastModifiedRecursive, getLastModifiedRecursive, getNavImageAlt, getNavImageSuffix, getNavImageURL, getNextPage, getOnloadScript, getPageIndexInParent, getParent, getPreferredContentWidth, getPreviousPage, getRedirectURL, getRootPage, getSearchLastModified, getServletContext, getShortTitle, getTitle, getURLParams, getURLPath, getURLPattern, getWebPage, getWebPage, getWebPage, getWebPage, getWebPageAndChildrenLastModified, getWebPageLayout, getWebPages, getWebSiteRequest, hashCode, includeNavImageAsParent, isHandler, isHandler, loadClass, printLoginForm, printUnauthorizedPage, reportingDoGet, reportingDoPost, reportingGetLastModified, search, showInLocationPath, standardSearch, useEncryption, useNavImage, useSiteMap
 
Methods inherited from class com.aoindustries.website.framework.ErrorReportingServlet
doGet, doPost, getGetCount, getLastModified, getLastModifiedCount, getLogger, getLogger, getLogger, getLoggerAccessor, getPostCount, getUptime, log, log
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, init
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLInputStreamPage

public HTMLInputStreamPage(LoggerAccessor loggerAccessor)

HTMLInputStreamPage

public HTMLInputStreamPage(WebSiteRequest req)

HTMLInputStreamPage

public HTMLInputStreamPage(LoggerAccessor loggerAccessor,
                           java.lang.Object param)
Method Detail

printStream

public void printStream(com.aoindustries.io.ChainWriter out,
                        WebSiteRequest req,
                        javax.servlet.http.HttpServletResponse resp,
                        java.io.InputStream in)
                 throws java.io.IOException,
                        java.sql.SQLException
Overrides:
printStream in class InputStreamPage
Throws:
java.io.IOException
java.sql.SQLException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets the file that the text should be read from.

Specified by:
getInputStream in class InputStreamPage
Throws:
java.io.IOException

getHTMLInputStream

public static java.io.InputStream getHTMLInputStream(java.lang.Class clazz)
                                              throws java.io.IOException
Gets the HTML file with the same name as the provided Class.

Throws:
java.io.IOException

printHTML

public static void printHTML(com.aoindustries.io.ChainWriter out,
                             WebSiteRequest req,
                             javax.servlet.http.HttpServletResponse resp,
                             WebPageLayout layout,
                             java.lang.String html,
                             java.lang.String linkClass)
                      throws java.io.IOException,
                             java.sql.SQLException
Prints HTML content, parsing for special @ tags. Types of tags include:

Throws:
java.io.IOException
java.sql.SQLException

printHTMLStream

public static void printHTMLStream(com.aoindustries.io.ChainWriter out,
                                   WebSiteRequest req,
                                   javax.servlet.http.HttpServletResponse resp,
                                   WebPageLayout layout,
                                   java.io.InputStream in,
                                   java.lang.String linkClass)
                            throws java.io.IOException,
                                   java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException
See Also:
printHTML(com.aoindustries.io.ChainWriter, com.aoindustries.website.framework.WebSiteRequest, javax.servlet.http.HttpServletResponse, com.aoindustries.website.framework.WebPageLayout, java.lang.String, java.lang.String)