www.element4solution.com

e4s.servlet
Class E4ServletImplementation_Servlet

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.servlet.E4ServletImplementation
          extended by e4s.servlet.E4ServletImplementation_Servlet
All Implemented Interfaces:
E4ServletImplementation_Intf

public class E4ServletImplementation_Servlet
extends E4ServletImplementation
implements E4ServletImplementation_Intf

Main and common implementation of the e4s when running on a web server such as Tomcat. Alternate implementations are E4ServletImplementation_Applet for local applets and E4ServletImplementation_Symbol for PDA environments.

Since:
JDK 1.4
See Also:
E4ServletImplementation_Applet, E4ServletImplementation_Symbol

Field Summary
 
Fields inherited from class e4s.servlet.E4ServletImplementation
COOKIE_PREFIX, COOKIE_SEPERATOR, m_last_alias, m_last_mref
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Fields inherited from interface e4s.servlet.E4ServletImplementation_Intf
PARAM_FUNCTION, PARAM_PRESERVED
 
Constructor Summary
E4ServletImplementation_Servlet(HttpServletRequest req, HttpServletResponse res)
           
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void assignCSS(int level, CSS_Name name)
          Assign a E4CSS style to the current session.
 java.lang.String closeHtmlOutput()
           
 E4DocumentBase defaultE4DocumentBase()
          This is the default document base, defined in e4settings#getDocBase().
 E4PersistantBase defaultPersistantBase()
           
 void flushBuffer()
           
 java.lang.String get(java.lang.String paramname)
          Get the CGI Parameter specified by the name.
 int getContentLength()
          Get the servlet's content length.
 java.lang.String getContentType()
          Get the servlet's content type.
 ServletContext getContext()
          Get the servlet's context.
 java.lang.String getCookie(java.lang.String name)
          Get value from a local cookie.
 CSS_Name getCSS(int level)
          Get the E4CSS style for the current session.
 java.text.SimpleDateFormat getDateTimeFormat()
          Get the date and time format.
 java.lang.String getHttpAddr()
          Get the HttpAddr out of the request context.
 int getMaxInactiveInterval()
          Gets the interactive timeout for the current session, this calls HttpRequest.getMaxInactiveInterval().
 long getOutputBufSize()
          Char's written to the output buffer.
 ServletOutputStream getOutputStream()
          The servlet response output stream.
 E4CgiParams getParameters()
          Collect the HTML (CGI) Parameters.
 E4CgiParams getParameters(boolean UTF8)
          Collect the HTML (CGI) Parameters.
 java.lang.String getPersistantParameter(java.lang.String paramname)
          Get a user dependent parameter from the user value settings.
 int[] getPersistantParameterIntArr(java.lang.String paramname)
          Get a user dependent parameter from the user value settings.
 E4StringBufferHtml getPreserved(java.lang.String preservedId)
          Get the buffer for the preserved element.
 java.lang.String getReferer()
          Returns the reference (from where it comes from)
 java.lang.String getRemoteAddr()
          Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
 HttpServletRequest getRequest()
          Get the servlet's request.
 HttpServletResponse getResponse()
          Get the servlet's response.
 HttpSession getSession()
          Get the servlet's session.
 java.lang.String getSessionId()
          Get the servlet's session identification.
 java.lang.Object getSessionObject(java.lang.String obj_id)
          Get a session object for the current user session.
 java.lang.Object getSessionObject(java.lang.String obj_id, boolean exception_not_found)
          Get a session object for the current user session.
 java.util.Hashtable getSessionObjects()
          Get a Hashtable containing all session objects.
 java.lang.String getUrl()
          Get the URL of the servlet itself.
 java.lang.String getUserAgent()
          Returns the user's browser.
 void invalidateSession(boolean immediatly)
          Invalidates the session, unbinds any objects related to this session.
 boolean invoceFunction()
           
 HTML invoceFunctionHTML(E4Method_Intf mref)
          Main function dispatcher
 HTML invoceFunctionHTML(E4Method_Intf mref, E4CgiParams params)
          Main function dispatcher
 boolean isRunningClient()
          Check, if the implementation of this interface is running in E4Client mode.
 boolean isRunningServer()
          Check, if the implementation of this interface is running in Server mode.
 void onExitTask()
          This function is called on exit of the current task.
 void openHtmlOutput()
           
 void rem(java.lang.String s)
           
 void removeSessionObject(java.lang.String obj_id)
          Remove a session object for the current user session.
 void removeSessionObjects()
          Removes all session objects for the current session.
 void sendmail(java.lang.Throwable t, java.lang.String txt)
          Sends an error mail to the mail address that is specified in E4Settings.getErrorMailto(), requires that mail is enabled (E4SendMail.isMailEnabled()).
 void setCookie(java.lang.String name, java.lang.String val)
          Store a value in a cookie.
static void setDefaultE4DocumentBase(E4DocumentBase base)
           
static void setDefaultPersistantBase(E4PersistantBase base)
           
 void setMaxInactiveInterval(int interval)
          Sets the interactive timeout for the current session, this calls HttpRequest.setMaxInactiveInterval().
 void setPersistantParameter(java.lang.String paramname, java.lang.String paramvalue)
          Save a user dependent parameter in the user value settings.
 void setSessionObject(E4SessionObject_Intf obj)
          Set a session object for the current user session.
 void setSessionObject(java.lang.String obj_id, java.lang.Object obj)
          Set a session object for the current user session.
 void SystemError(E4DBException dbe)
           
 void SystemError(E4ServletInvocationError sie)
           
 void SystemError(int errortype, java.lang.Throwable t, java.lang.String txt)
           
 void SystemError(java.io.IOException ioe)
           
 void SystemError(org.xml.sax.SAXParseException spe)
           
 void SystemError(java.lang.String errormsg)
           
 void SystemError(java.lang.Throwable t)
           
 void write(java.awt.image.BufferedImage image)
          Write an image (as graphic) to the servlet's context.
 void write(java.awt.image.BufferedImage image, java.lang.String contentType)
          Write an image (as graphic) to the servlet's context.
 void write(E4HtmlElement element)
          Execute the E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) functions for this element and append the HTML content generated to the current output buffer.
 void write(HTML element, boolean silent)
          Execute the E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) functions for this element and append the HTML content generated to the current output buffer.
 void write(java.lang.String s)
           
 void write(java.lang.StringBuffer s)
           
 void writeln(java.lang.String s)
           
 void writePreserved(java.lang.String id, E4HtmlElement_Intf element)
          Store any (typically frame) content for later output by the function writePreservedOut().
 boolean writePreservedOut()
          Process (write out) any prestored output.
 
Methods inherited from class e4s.servlet.E4ServletImplementation
getApplication, getApplObj, getClient, getClientObject, getClientObject, getClientObject, getClientValue, getClientValue, getClientValue, getClientValueBool, getClientValueBool, getClientValueDate, getClientValueDate, getClientValueFloat, getClientValueFloat, getClientValueInt, getClientValueInt, getClientValueLong, getClientValueLong, getCompany_Group, getCookieArr, getCookieBool, getCookieDate, getCookieLong, getCountryCode, getDateFormat, getDecimalSign, getLanguage, getPickParams, getSessionObject_Boolean, getSessionObject_Long, getSessionObject_String, getStartupTime, getTimeFormat, getTimeZone, getUser, getUserValue, getUserValueBool, getUserValueDate, getUserValueIDs, getUserValueInt, getUserValueLong, invoceFunctionHTML, isRunningWindow, removeApplicationObject, removeClientObject, removeClientObject, removeClientObject, removeClientObject, removeClientValue, removeClientValue, removeSessionObject, removeUserValue, sessionCanEditHints, sessionCanEditHints, sessionCanEditStyles, sessionCanEditStyles, sessionCanEditTranslations, sessionCanEditTranslations, setApplicationObject, setClientObject, setClientObject, setClientObject, setClientObject, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setSessionObject, setSessionObject, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface e4s.servlet.E4ServletImplementation_Intf
getApplObj, getClient, getClientObject, getClientObject, getClientValue, getClientValueBool, getClientValueDate, getClientValueFloat, getClientValueInt, getClientValueLong, getCookieArr, getCookieBool, getCookieDate, getCookieLong, getCountryCode, getDateFormat, getDecimalSign, getLanguage, getPickParams, getSessionObject_Boolean, getSessionObject_Long, getSessionObject_String, getTimeFormat, getTimeZone, getUserValue, getUserValueBool, getUserValueDate, getUserValueInt, getUserValueLong, isRunningWindow, removeApplicationObject, removeClientObject, removeClientObject, removeClientObject, removeClientValue, removeSessionObject, removeUserValue, sessionCanEditHints, sessionCanEditHints, sessionCanEditStyles, sessionCanEditStyles, sessionCanEditTranslations, sessionCanEditTranslations, setApplicationObject, setClientObject, setClientObject, setClientObject, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setSessionObject, setSessionObject, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue
 

Constructor Detail

E4ServletImplementation_Servlet

public E4ServletImplementation_Servlet(HttpServletRequest req,
                                       HttpServletResponse res)
                                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getRequest

public HttpServletRequest getRequest()
Get the servlet's request. See apache documentation.

Returns:
the servlet's request
See Also:
getContext(), getResponse()

getResponse

public HttpServletResponse getResponse()
Get the servlet's response. See apache documentation.

Returns:
the servlet's response
See Also:
getContext(), getRequest()

getContext

public ServletContext getContext()
Get the servlet's context. See apache documentation.

Returns:
the servlet's context
See Also:
getResponse(), getRequest()

isRunningServer

public boolean isRunningServer()
Description copied from interface: E4ServletImplementation_Intf
Check, if the implementation of this interface is running in Server mode. A server needs an Apache Tomcat or similar, URL's are passed to the server and the CGI interface is used.

Specified by:
isRunningServer in interface E4ServletImplementation_Intf
Returns:
true, if running in Server environment, false if running in E4Client environment
See Also:
E4ServletImplementation_Servlet, E4ServletImplementation_Intf.isRunningClient()

isRunningClient

public boolean isRunningClient()
Description copied from interface: E4ServletImplementation_Intf
Check, if the implementation of this interface is running in E4Client mode. A client covers the CGI implementation and URL handling with E4JavaScript functions, instead of a servlet a applet is included into a web page that handles all the interaction between the browser and the e4s.

Specified by:
isRunningClient in interface E4ServletImplementation_Intf
Returns:
true, if running in E4Client environment, false if running in Server environment
See Also:
E4ServletImplementation_Intf.isRunningServer()

openHtmlOutput

public void openHtmlOutput()
Specified by:
openHtmlOutput in interface E4ServletImplementation_Intf

flushBuffer

public void flushBuffer()

writeln

public void writeln(java.lang.String s)
Specified by:
writeln in interface E4ServletImplementation_Intf

write

public void write(java.lang.String s)
Specified by:
write in interface E4ServletImplementation_Intf

write

public void write(java.lang.StringBuffer s)

rem

public void rem(java.lang.String s)
Specified by:
rem in interface E4ServletImplementation_Intf

closeHtmlOutput

public java.lang.String closeHtmlOutput()
Specified by:
closeHtmlOutput in interface E4ServletImplementation_Intf

write

public void write(E4HtmlElement element)
           throws java.lang.Exception
Execute the E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) functions for this element and append the HTML content generated to the current output buffer.

Specified by:
write in interface E4ServletImplementation_Intf
Parameters:
element - the HTML element to be rendered
Throws:
java.lang.Exception
See Also:
E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf)

write

public void write(HTML element,
                  boolean silent)
           throws java.lang.Exception
Execute the E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) functions for this element and append the HTML content generated to the current output buffer.

Parameters:
element - the HTML element to be rendered
Throws:
java.lang.Exception
See Also:
E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf)

writePreserved

public void writePreserved(java.lang.String id,
                           E4HtmlElement_Intf element)
Store any (typically frame) content for later output by the function writePreservedOut().

Specified by:
writePreserved in interface E4ServletImplementation_Intf
Parameters:
id - the value of the E4ServletImplementation_Intf.PARAM_PRESERVED parameter as generated by the FRAMESET.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) function.
element - the element to convert into plain Html
See Also:
E4ServletImplementation_Intf.writePreserved(String,E4HtmlElement_Intf), FRAMESET.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf), E4ServletImplementation_Intf.writePreservedOut()

writePreservedOut

public boolean writePreservedOut()
Description copied from interface: E4ServletImplementation_Intf
Process (write out) any prestored output. See FRAMESET and E4ServletImplementation_Intf.writePreserved(java.lang.String, e4s.html.E4HtmlElement_Intf). This function needs to be placed in doPost() or doGet() before any other actions take place.

Specified by:
writePreservedOut in interface E4ServletImplementation_Intf
Returns:
true, if there was a requested ID (by the E4ServletImplementation_Intf.PARAM_PRESERVED parameter. In this case, no further output or action is needed. false, no preserved requested ID available, normal proceeding recommended.
See Also:
E4ServletImplementation_Intf.writePreservedOut()

getPreserved

public E4StringBufferHtml getPreserved(java.lang.String preservedId)
Description copied from interface: E4ServletImplementation_Intf
Get the buffer for the preserved element.

Specified by:
getPreserved in interface E4ServletImplementation_Intf
Returns:
the buffer associated with preservedId
See Also:
E4ServletImplementation_Intf.writePreservedOut(), E4ServletImplementation_Intf.writePreserved( String, E4HtmlElement_Intf ), e4s.E4Constants#PARAM_PRESERVED

invoceFunctionHTML

public HTML invoceFunctionHTML(E4Method_Intf mref)
Main function dispatcher

Specified by:
invoceFunctionHTML in interface E4ServletImplementation_Intf

invoceFunctionHTML

public HTML invoceFunctionHTML(E4Method_Intf mref,
                               E4CgiParams params)
Main function dispatcher

Specified by:
invoceFunctionHTML in interface E4ServletImplementation_Intf
Parameters:
mref - the function beeing called
params - the CgiParameters

get

public java.lang.String get(java.lang.String paramname)
Get the CGI Parameter specified by the name. This function takes care of the Multi-Part request mechanism depending on the content type of the header.

Parameters:
paramname - the name of the parameter
Returns:
the value for the parameter We recommend the usage of the E4CgiParams using getParameters().

invoceFunction

public boolean invoceFunction()
Specified by:
invoceFunction in interface E4ServletImplementation_Intf

getParameters

public E4CgiParams getParameters()
                          throws java.lang.Exception
Collect the HTML (CGI) Parameters.

Specified by:
getParameters in interface E4ServletImplementation_Intf
Returns:
an object containing all the CGI parameters
Throws:
java.lang.Exception

getParameters

public E4CgiParams getParameters(boolean UTF8)
Collect the HTML (CGI) Parameters.

Parameters:
UTF8 - true: switch servlet request into UTF-8 mode
Returns:
an object containing all the CGI parameters

getUrl

public java.lang.String getUrl()
Get the URL of the servlet itself. Example: when your servlet zone in Tomcat is named "zoneX" and your servlet is mapped to "servletY" then this function would return "/zoneX/servletY".

Specified by:
getUrl in interface E4ServletImplementation_Intf
Returns:
the servlet's URL

getSessionId

public java.lang.String getSessionId()
Get the servlet's session identification. Uses HttpSession.getSession()

Specified by:
getSessionId in interface E4ServletImplementation_Intf
Specified by:
getSessionId in class E4ServletImplementation
Returns:
the session handler
See Also:
E4ServletImplementation_Intf.invalidateSession(boolean), E4ServletImplementation_Intf.getSession()

getSession

public HttpSession getSession()
Get the servlet's session.

Specified by:
getSession in interface E4ServletImplementation_Intf
Returns:
the session object
See Also:
E4ServletImplementation_Intf.invalidateSession(boolean), E4ServletImplementation_Intf.getSessionId()

getSessionObject

public java.lang.Object getSessionObject(java.lang.String obj_id)
Get a session object for the current user session.

Specified by:
getSessionObject in interface E4ServletImplementation_Intf
Specified by:
getSessionObject in class E4ServletImplementation
Parameters:
obj_id - identifyer for the object
Returns:
null if not found, or the object associated with this id.
See Also:
removeSessionObject( String ), setSessionObject( String, Object ), getSessionObjects(), E4ServletImplementation.setSessionObject( String, boolean ), E4ServletImplementation.setSessionObject( String, long ), E4ServletImplementation.getSessionObject_String( String ), E4ServletImplementation.getSessionObject_Long( String ), E4ServletImplementation.getSessionObject_Boolean( String )

getSessionObject

public java.lang.Object getSessionObject(java.lang.String obj_id,
                                         boolean exception_not_found)
                                  throws E4Exception
Get a session object for the current user session.

Specified by:
getSessionObject in interface E4ServletImplementation_Intf
Parameters:
obj_id - identifyer for the object
exception_not_found - if true, throws an exception if session object cannot be found
Returns:
null if not found, or the object associated with this id.
Throws:
E4Exception
See Also:
removeSessionObject( String ), setSessionObject( String, Object ), getSessionObjects(), E4ServletImplementation.setSessionObject( String, boolean ), E4ServletImplementation.setSessionObject( String, long ), E4ServletImplementation.getSessionObject_String( String ), E4ServletImplementation.getSessionObject_Long( String ), E4ServletImplementation.getSessionObject_Boolean( String )

setSessionObject

public void setSessionObject(E4SessionObject_Intf obj)
Set a session object for the current user session.

Specified by:
setSessionObject in interface E4ServletImplementation_Intf
Parameters:
obj - the object to be stored
See Also:
removeSessionObject( String ), getSessionObject( String ), getSessionObjects(), E4ServletImplementation.setSessionObject( String, boolean ), E4ServletImplementation.setSessionObject( String, long ), E4ServletImplementation.getSessionObject_String( String ), E4ServletImplementation.getSessionObject_Long( String ), E4ServletImplementation.getSessionObject_Boolean( String )

setSessionObject

public void setSessionObject(java.lang.String obj_id,
                             java.lang.Object obj)
Set a session object for the current user session.

Specified by:
setSessionObject in interface E4ServletImplementation_Intf
Specified by:
setSessionObject in class E4ServletImplementation
Parameters:
obj_id - identifyer for the object
obj - the object to be stored
See Also:
removeSessionObject( String ), getSessionObject( String ), getSessionObjects(), E4ServletImplementation.setSessionObject( String, boolean ), E4ServletImplementation.setSessionObject( String, long ), E4ServletImplementation.getSessionObject_String( String ), E4ServletImplementation.getSessionObject_Long( String ), E4ServletImplementation.getSessionObject_Boolean( String )

getSessionObjects

public java.util.Hashtable getSessionObjects()
Get a Hashtable containing all session objects.

Specified by:
getSessionObjects in interface E4ServletImplementation_Intf
Specified by:
getSessionObjects in class E4ServletImplementation
Returns:
null if no Hashtable is defined, or a Hashtable containing the objects.
See Also:
removeSessionObject( String ), setSessionObject( String, Object ), getSessionObject( String ), E4ServletImplementation.setSessionObject( String, boolean ), E4ServletImplementation.setSessionObject( String, long ), E4ServletImplementation.getSessionObject_String( String ), E4ServletImplementation.getSessionObject_Long( String ), E4ServletImplementation.getSessionObject_Boolean( String )

removeSessionObject

public void removeSessionObject(java.lang.String obj_id)
Remove a session object for the current user session.

Specified by:
removeSessionObject in interface E4ServletImplementation_Intf
Specified by:
removeSessionObject in class E4ServletImplementation
Parameters:
obj_id - identifyer for the object
See Also:
getSessionObject( String ), setSessionObject( String, Object ), getSessionObjects(), E4ServletImplementation.setSessionObject( String, boolean ), E4ServletImplementation.setSessionObject( String, long ), E4ServletImplementation.getSessionObject_String( String ), E4ServletImplementation.getSessionObject_Long( String ), E4ServletImplementation.getSessionObject_Boolean( String )

removeSessionObjects

public void removeSessionObjects()
Description copied from interface: E4ServletImplementation_Intf
Removes all session objects for the current session.

Specified by:
removeSessionObjects in interface E4ServletImplementation_Intf

getDateTimeFormat

public java.text.SimpleDateFormat getDateTimeFormat()
Get the date and time format.

Specified by:
getDateTimeFormat in interface E4ServletImplementation_Intf
Returns:
e.g. new SimpleDateFormat("dd.MM.yyyy HH:mm:ss") - depending on the logged in user settings.
See Also:
E4ServletImplementation_Intf.getDateFormat(), E4ServletImplementation_Intf.getTimeFormat()

SystemError

public void SystemError(java.lang.Throwable t)
Specified by:
SystemError in interface E4ServletImplementation_Intf

SystemError

public void SystemError(E4DBException dbe)
Specified by:
SystemError in interface E4ServletImplementation_Intf

SystemError

public void SystemError(org.xml.sax.SAXParseException spe)

SystemError

public void SystemError(java.io.IOException ioe)
Specified by:
SystemError in interface E4ServletImplementation_Intf

SystemError

public void SystemError(E4ServletInvocationError sie)

SystemError

public void SystemError(int errortype,
                        java.lang.Throwable t,
                        java.lang.String txt)
Specified by:
SystemError in interface E4ServletImplementation_Intf

SystemError

public void SystemError(java.lang.String errormsg)
Specified by:
SystemError in interface E4ServletImplementation_Intf

defaultE4DocumentBase

public E4DocumentBase defaultE4DocumentBase()
This is the default document base, defined in e4settings#getDocBase().

Specified by:
defaultE4DocumentBase in interface E4ServletImplementation_Intf
Returns:
e.g. new E4DocumentBase("/e4s/")
See Also:
setDefaultE4DocumentBase(e4s.html.E4DocumentBase), e4settings#getDocBase()

setDefaultE4DocumentBase

public static void setDefaultE4DocumentBase(E4DocumentBase base)

defaultPersistantBase

public E4PersistantBase defaultPersistantBase()
Specified by:
defaultPersistantBase in interface E4ServletImplementation_Intf

setDefaultPersistantBase

public static void setDefaultPersistantBase(E4PersistantBase base)

setPersistantParameter

public void setPersistantParameter(java.lang.String paramname,
                                   java.lang.String paramvalue)
Save a user dependent parameter in the user value settings.

Specified by:
setPersistantParameter in interface E4ServletImplementation_Intf
Parameters:
paramname - name of the parameter
paramvalue - value for this parameter
See Also:
E4ServletImplementation_Intf.getPersistantParameter(java.lang.String), #getSystemParameter

getPersistantParameter

public java.lang.String getPersistantParameter(java.lang.String paramname)
Get a user dependent parameter from the user value settings.

Specified by:
getPersistantParameter in interface E4ServletImplementation_Intf
Parameters:
paramname - name of the parameter
Returns:
value of the parameter
See Also:
E4ServletImplementation_Intf.setPersistantParameter(java.lang.String, java.lang.String), #setSystemParameter, E4ServletImplementation_Intf.getPersistantParameterIntArr(java.lang.String)

getPersistantParameterIntArr

public int[] getPersistantParameterIntArr(java.lang.String paramname)
Get a user dependent parameter from the user value settings. For integer array value only.

Specified by:
getPersistantParameterIntArr in interface E4ServletImplementation_Intf
Parameters:
paramname - name of the parameter
Returns:
value of the parameters
See Also:
E4ServletImplementation_Intf.getPersistantParameter(java.lang.String), E4ServletImplementation_Intf.getPersistantParameterIntArr(java.lang.String)

getOutputBufSize

public long getOutputBufSize()
Char's written to the output buffer.

Returns:
size of the output stream so far. Value gets stored until closing of buffer.

getOutputStream

public ServletOutputStream getOutputStream()
The servlet response output stream.

Returns:
the out stream

assignCSS

public void assignCSS(int level,
                      CSS_Name name)
               throws E4Exception
Assign a E4CSS style to the current session. Note that there might be several E4CSS definitions, each containing of STYLE definitions for different useres running in different sessions.

Specified by:
assignCSS in interface E4ServletImplementation_Intf
Parameters:
name - the name of the E4CSS to be associated with this session
Throws:
E4Exception
See Also:
E4CssFile, #getCSS(integer)

getCSS

public CSS_Name getCSS(int level)
Get the E4CSS style for the current session.

Specified by:
getCSS in interface E4ServletImplementation_Intf
Returns:
the name of the E4CSS, or if no E4CSS is defined return the default E4CSS name.
See Also:
E4CssFile, assignCSS(int, e4s.html.style.CSS_Name)

setCookie

public void setCookie(java.lang.String name,
                      java.lang.String val)
Store a value in a cookie. A cookie is an object that is stored locally on the client's machine, and requires clients who enable cookies in their browser settings.

Specified by:
setCookie in interface E4ServletImplementation_Intf
Specified by:
setCookie in class E4ServletImplementation
Parameters:
name - the name of the cookie
val - the value of the cookie
See Also:
E4ServletImplementation.setCookie(String,String[]), E4ServletImplementation.setCookie(String,boolean), E4ServletImplementation.setCookie(String,long), E4ServletImplementation.setCookie(String,int), E4ServletImplementation.setCookie(String,e4s.util.E4String), E4ServletImplementation.setCookie(String,e4s.util.E4Long), E4ServletImplementation.setCookie(String,java.util.Date), #getCookie()

getCookie

public java.lang.String getCookie(java.lang.String name)
Get value from a local cookie.

Specified by:
getCookie in interface E4ServletImplementation_Intf
Specified by:
getCookie in class E4ServletImplementation
Parameters:
name - the name of the cookie
Returns:
the value to be stored in the cookie.
See Also:
#setCookie(String)

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets.

Specified by:
getRemoteAddr in interface E4ServletImplementation_Intf
Overrides:
getRemoteAddr in class E4ServletImplementation
Returns:
a String containing the IP address of the client that sent the request

getUserAgent

public java.lang.String getUserAgent()
Returns the user's browser.

Returns:
a String like 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; H010818; .NET CLR 1.0.3705; .NET CLR 1.1.4322)'

getReferer

public java.lang.String getReferer()
Returns the reference (from where it comes from)

Returns:
the reference.

getContentType

public java.lang.String getContentType()
Get the servlet's content type.

See Also:
getContentLength()

getContentLength

public int getContentLength()
Get the servlet's content length.

See Also:
getContentType()

sendmail

public void sendmail(java.lang.Throwable t,
                     java.lang.String txt)
Sends an error mail to the mail address that is specified in E4Settings.getErrorMailto(), requires that mail is enabled (E4SendMail.isMailEnabled()).

Parameters:
t - the error
txt - some additional text
See Also:
E4Settings.getErrorMailto(), E4SendMail.isMailEnabled(), E4Util.getRevisionCodeFromSVN(Class), _getSVNVersionString(), e4s.html.SystemError

invalidateSession

public void invalidateSession(boolean immediatly)
Invalidates the session, unbinds any objects related to this session. In the servlet implementation, this performes a call to getSession().invalidate().

Specified by:
invalidateSession in interface E4ServletImplementation_Intf
Parameters:
immediatly - true: immediatly terminates the session now, false: terminates the session an servlet exit
See Also:
getSession(), getSessionId()

onExitTask

public void onExitTask()
Description copied from interface: E4ServletImplementation_Intf
This function is called on exit of the current task.

Specified by:
onExitTask in interface E4ServletImplementation_Intf

getHttpAddr

public java.lang.String getHttpAddr()
Get the HttpAddr out of the request context. The difference to E4Settings.getHttpAddr() is, that this value is really taken from the servlet request and not from the .ini file of the application which can be defined by an administrative user (e.g. without any port information). It is recommended, that you will use the value from E4Settings.getHttpAddr() which in the case it is not defined will be taken from this function here initially.

Specified by:
getHttpAddr in interface E4ServletImplementation_Intf
Returns:
e.g. http://myserver:80/servlet_path/content_path
See Also:
E4Settings.getHttpAddr()

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Sets the interactive timeout for the current session, this calls HttpRequest.setMaxInactiveInterval().

Parameters:
interval - seconds of timeout
See Also:
getMaxInactiveInterval(), FRAMESET.addKeepAliveScript(e4s.servlet.E4ServletImplementation_Intf), BODY.addKeepAliveScript(e4s.servlet.E4ServletImplementation_Intf)

getMaxInactiveInterval

public int getMaxInactiveInterval()
Gets the interactive timeout for the current session, this calls HttpRequest.getMaxInactiveInterval().

Returns:
seconds of interactive timeout
See Also:
setMaxInactiveInterval(int), FRAMESET.addKeepAliveScript(e4s.servlet.E4ServletImplementation_Intf), BODY.addKeepAliveScript(e4s.servlet.E4ServletImplementation_Intf)

write

public void write(java.awt.image.BufferedImage image)
           throws java.io.IOException
Write an image (as graphic) to the servlet's context.

Parameters:
image - the image
Throws:
java.io.IOException
See Also:
write(BufferedImage,String)

write

public void write(java.awt.image.BufferedImage image,
                  java.lang.String contentType)
           throws java.io.IOException
Write an image (as graphic) to the servlet's context.

Parameters:
image - the image
Throws:
java.io.IOException
See Also:
write(BufferedImage)

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com