com.judoscript.jusp
Class JuspServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.judoscript.jusp.JuspServlet
All Implemented Interfaces:
JuspContext, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class JuspServlet
extends javax.servlet.http.HttpServlet
implements JuspContext

See Also:
Serialized Form

Field Summary
static boolean isLocal
           
static org.apache.commons.logging.Log logger
           
 
Constructor Summary
JuspServlet()
           
 
Method Summary
 void error(JuspRequest request, JuspResponse response, javax.servlet.http.HttpSession session, java.lang.Throwable ex)
           
 void forward(java.lang.String uri, java.lang.String refUri, java.lang.String refFilePath, JuspRequest request, JuspResponse response, javax.servlet.http.HttpSession session, java.lang.Object form, java.lang.Object error)
           
 java.lang.String getContextBasePath()
           
 java.lang.String getContextBaseURI()
           
 java.lang.String getJuspWorkDir()
           
 int getUploadMaxMemorySize()
           
 long getUploadMaxRequestSize()
           
 java.lang.String getUploadTempDirectory()
           
 java.lang.String[] getUriAndPath(java.lang.Object request)
           
 void init(javax.servlet.ServletConfig config)
          Does these steps: Prepare the JuSP preprocessor, "com/judoscript/jusp/jusp_prep.judo".
 void invoke(java.lang.String uri, java.lang.String refUri, java.lang.String refFilePath, JuspRequest request, JuspResponse response, javax.servlet.http.HttpSession session, java.lang.Object form, java.lang.Object error)
           
 void redirect(java.lang.String uri, JuspResponse response)
           
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void setCheckTimestamp(boolean set)
           
 void setDefaultContentType(java.lang.String type)
           
 void setDefaultPageEncoding(java.lang.String enc)
           
 void setPrintStackTrace(boolean set)
           
 void setSystemErrorPageURI(java.lang.String uri)
           
 void setUploadLimits(int maxMemSize, long maxRequestSize)
           
 void setUploadTempDir(java.lang.String tmpDir)
           
 void setUserErrorPageURI(java.lang.String uri)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static org.apache.commons.logging.Log logger

isLocal

public static boolean isLocal
Constructor Detail

JuspServlet

public JuspServlet()
Method Detail

getJuspWorkDir

public java.lang.String getJuspWorkDir()
Specified by:
getJuspWorkDir in interface JuspContext

setCheckTimestamp

public void setCheckTimestamp(boolean set)
Specified by:
setCheckTimestamp in interface JuspContext

setDefaultContentType

public void setDefaultContentType(java.lang.String type)
Specified by:
setDefaultContentType in interface JuspContext

setDefaultPageEncoding

public void setDefaultPageEncoding(java.lang.String enc)
Specified by:
setDefaultPageEncoding in interface JuspContext

setSystemErrorPageURI

public void setSystemErrorPageURI(java.lang.String uri)
Specified by:
setSystemErrorPageURI in interface JuspContext

setUserErrorPageURI

public void setUserErrorPageURI(java.lang.String uri)
Specified by:
setUserErrorPageURI in interface JuspContext

setPrintStackTrace

public void setPrintStackTrace(boolean set)

getUploadMaxMemorySize

public int getUploadMaxMemorySize()
Specified by:
getUploadMaxMemorySize in interface JuspContext

getUploadMaxRequestSize

public long getUploadMaxRequestSize()
Specified by:
getUploadMaxRequestSize in interface JuspContext

getUploadTempDirectory

public java.lang.String getUploadTempDirectory()
Specified by:
getUploadTempDirectory in interface JuspContext

setUploadLimits

public void setUploadLimits(int maxMemSize,
                            long maxRequestSize)
Specified by:
setUploadLimits in interface JuspContext

setUploadTempDir

public void setUploadTempDir(java.lang.String tmpDir)
Specified by:
setUploadTempDir in interface JuspContext

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Does these steps:
  1. Prepare the JuSP preprocessor, "com/judoscript/jusp/jusp_prep.judo".
  2. Parse "juspInit.judo" or what's specified by 'juspInitFile'.
  3. creates a global runtime context and add global variables, and
  4. runs the JuSP initialization script within.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

getContextBasePath

public java.lang.String getContextBasePath()
Specified by:
getContextBasePath in interface JuspContext

getContextBaseURI

public java.lang.String getContextBaseURI()
Specified by:
getContextBaseURI in interface JuspContext

getUriAndPath

public java.lang.String[] getUriAndPath(java.lang.Object request)

invoke

public void invoke(java.lang.String uri,
                   java.lang.String refUri,
                   java.lang.String refFilePath,
                   JuspRequest request,
                   JuspResponse response,
                   javax.servlet.http.HttpSession session,
                   java.lang.Object form,
                   java.lang.Object error)
            throws javax.servlet.ServletException,
                   java.io.IOException
Specified by:
invoke in interface JuspContext
Throws:
javax.servlet.ServletException
java.io.IOException

forward

public void forward(java.lang.String uri,
                    java.lang.String refUri,
                    java.lang.String refFilePath,
                    JuspRequest request,
                    JuspResponse response,
                    javax.servlet.http.HttpSession session,
                    java.lang.Object form,
                    java.lang.Object error)
             throws javax.servlet.ServletException,
                    java.io.IOException
Specified by:
forward in interface JuspContext
Throws:
javax.servlet.ServletException
java.io.IOException

redirect

public void redirect(java.lang.String uri,
                     JuspResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Specified by:
redirect in interface JuspContext
Throws:
javax.servlet.ServletException
java.io.IOException

error

public void error(JuspRequest request,
                  JuspResponse response,
                  javax.servlet.http.HttpSession session,
                  java.lang.Throwable ex)
           throws javax.servlet.ServletException,
                  java.io.IOException
Specified by:
error in interface JuspContext
Throws:
javax.servlet.ServletException
java.io.IOException