org.infolayer.servlet
Class RequestHandler

java.lang.Object
  extended byorg.infolayer.templates.IlRequest
      extended byorg.infolayer.servlet.RequestHandler

public class RequestHandler
extends IlRequest

One-Way object that handles a single request. The purpose is to avoid the request and response parameters when calling subroutines.


Field Summary
 TemplateLoader loader
           
 UmlModel model
           
 HttpServletRequest request
           
 HttpServletResponse response
          Instead of direct access to the response, please use setResponseEncoding(), setContentType(), getOutputStream(), ...
 IlServlet servlet
           
 
Constructor Summary
RequestHandler(IlServlet servlet, HttpServletRequest request, HttpServletResponse response)
           
 
Method Summary
 void doGet()
           
 void doPost()
           
 void error(java.lang.String id, java.lang.String message)
          Generate an error message
 java.lang.String getBasePath()
          Starts with a slash, but does not end with a slash; for the root, this is the empty string (!)
 java.lang.String getCookie(java.lang.String name)
           
 java.lang.String getHeader(java.lang.String name)
           
 java.lang.String getHost()
           
 java.lang.String getLang()
           
 TemplateLoader getLoader()
           
 UmlModel getModel()
           
 IlUrl getNextUrl()
           
 java.io.OutputStream getOutputStream()
           
 java.lang.String getRequestEncoding()
          Returns the character encoding probably used for the request.
 IlUrl getRequestUrl()
          Returns the original, unmodified URL of the request
 java.lang.String getResponseEncoding()
           
 IlUrl getUrl()
          Returns the URL of the request with possible local property or mode changes (for example in the case of an include or form).
 XmlSerializer getXmlSerializer()
          A special encoding can be forced using the encoding parameter.
 void preanlyzeData()
          Performs a HTTP get by filling a template or transferring a file depending on the url and query fields of this object.
 void seeOther(IlUrl newUrl)
          Redirects the browser to the stack top url
 void setContentType(java.lang.String contentType)
           
 void setCookie(java.lang.String name, java.lang.String value)
           
 void setFollowup(java.lang.String followup)
           
 void setResponseEncoding(java.lang.String enc)
           
 void setUrl(IlUrl url)
           
 void writeDir(java.io.File dir, java.lang.String title)
           
 void writeError(int code, java.lang.String text, java.lang.Exception exception)
           
 
Methods inherited from class org.infolayer.templates.IlRequest
getControl, getEnclose, getI18n, getId, getUrl, getUrl, setControl, setEnclose
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servlet

public IlServlet servlet

loader

public TemplateLoader loader

model

public UmlModel model

request

public HttpServletRequest request

response

public HttpServletResponse response
Instead of direct access to the response, please use setResponseEncoding(), setContentType(), getOutputStream(), ...

Constructor Detail

RequestHandler

public RequestHandler(IlServlet servlet,
                      HttpServletRequest request,
                      HttpServletResponse response)
Method Detail

error

public void error(java.lang.String id,
                  java.lang.String message)
Generate an error message


setResponseEncoding

public void setResponseEncoding(java.lang.String enc)
Specified by:
setResponseEncoding in class IlRequest

setContentType

public void setContentType(java.lang.String contentType)
Specified by:
setContentType in class IlRequest

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Specified by:
getOutputStream in class IlRequest
Throws:
java.io.IOException

getRequestEncoding

public java.lang.String getRequestEncoding()
Returns the character encoding probably used for the request.

Specified by:
getRequestEncoding in class IlRequest

getXmlSerializer

public XmlSerializer getXmlSerializer()
                               throws java.io.IOException
A special encoding can be forced using the encoding parameter. If so, it probably makes sense to set the same encoding in the content

Specified by:
getXmlSerializer in class IlRequest
Throws:
java.io.IOException

getLoader

public TemplateLoader getLoader()
Specified by:
getLoader in class IlRequest

getModel

public UmlModel getModel()
Specified by:
getModel in class IlRequest

getRequestUrl

public IlUrl getRequestUrl()
Returns the original, unmodified URL of the request

Specified by:
getRequestUrl in class IlRequest

getUrl

public IlUrl getUrl()
Returns the URL of the request with possible local property or mode changes (for example in the case of an include or form).

Specified by:
getUrl in class IlRequest

getHeader

public java.lang.String getHeader(java.lang.String name)
Specified by:
getHeader in class IlRequest

getLang

public java.lang.String getLang()
Specified by:
getLang in class IlRequest

setFollowup

public void setFollowup(java.lang.String followup)

preanlyzeData

public void preanlyzeData()
Performs a HTTP get by filling a template or transferring a file depending on the url and query fields of this object.


doGet

public void doGet()
           throws java.io.IOException,
                  ServletException
Throws:
java.io.IOException
ServletException

getBasePath

public java.lang.String getBasePath()
Starts with a slash, but does not end with a slash; for the root, this is the empty string (!)

Specified by:
getBasePath in class IlRequest

setUrl

public void setUrl(IlUrl url)
Specified by:
setUrl in class IlRequest

setCookie

public void setCookie(java.lang.String name,
                      java.lang.String value)
Specified by:
setCookie in class IlRequest

getCookie

public java.lang.String getCookie(java.lang.String name)
Specified by:
getCookie in class IlRequest

writeDir

public void writeDir(java.io.File dir,
                     java.lang.String title)
              throws XmlPullParserException,
                     java.io.IOException
Throws:
XmlPullParserException
java.io.IOException

writeError

public void writeError(int code,
                       java.lang.String text,
                       java.lang.Exception exception)
                throws java.io.IOException
Throws:
java.io.IOException

doPost

public void doPost()
            throws java.io.IOException,
                   ServletException
Throws:
java.io.IOException
ServletException

getNextUrl

public IlUrl getNextUrl()
                 throws java.io.IOException
Throws:
java.io.IOException

seeOther

public void seeOther(IlUrl newUrl)
              throws java.io.IOException
Redirects the browser to the stack top url

Throws:
java.io.IOException

getHost

public java.lang.String getHost()
Specified by:
getHost in class IlRequest

getResponseEncoding

public java.lang.String getResponseEncoding()
Specified by:
getResponseEncoding in class IlRequest