Package helma.servlet
Class AbstractServletClient
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- helma.servlet.AbstractServletClient
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
EmbeddedServletClient
,StandaloneServletClient
public abstract class AbstractServletClient extends javax.servlet.http.HttpServlet
This is an abstract Hop servlet adapter. This class communicates with hop applications via RMI. Subclasses are either one servlet per app, or one servlet that handles multiple apps- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractServletClient()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Application
getApplication()
Abstract method to get theApplicaton
instance the servlet is talking to.java.lang.String
getServletInfo()
Return servlet infovoid
init(javax.servlet.ServletConfig init)
Init this servlet.static void
parseParameters(java.util.Map map, byte[] data, java.lang.String encoding, boolean isPost)
Append request parameters from the specified String to the specified Map.protected void
parseParameters(javax.servlet.http.HttpServletRequest request, RequestTrans reqtrans, java.lang.String encoding)
protected java.util.List
parseUploads(org.apache.commons.fileupload.servlet.ServletRequestContext reqcx, RequestTrans reqtrans, UploadStatus uploadStatus, java.lang.String encoding)
protected void
service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handle a request.protected void
writeResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, RequestTrans hopreq, ResponseTrans hopres)
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig init) throws javax.servlet.ServletException
Init this servlet.- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Parameters:
init
- the servlet configuration- Throws:
javax.servlet.ServletException
- ...
-
getApplication
public abstract Application getApplication()
Abstract method to get theApplicaton
instance the servlet is talking to.- Returns:
- this servlet's application instance
-
service
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
Handle a request.- Overrides:
service
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- ...response
- ...- Throws:
javax.servlet.ServletException
- ...java.io.IOException
- ...
-
writeResponse
protected void writeResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, RequestTrans hopreq, ResponseTrans hopres) throws java.io.IOException
- Throws:
java.io.IOException
-
parseUploads
protected java.util.List parseUploads(org.apache.commons.fileupload.servlet.ServletRequestContext reqcx, RequestTrans reqtrans, UploadStatus uploadStatus, java.lang.String encoding) throws org.apache.commons.fileupload.FileUploadException, java.io.UnsupportedEncodingException
- Throws:
org.apache.commons.fileupload.FileUploadException
java.io.UnsupportedEncodingException
-
parseParameters
protected void parseParameters(javax.servlet.http.HttpServletRequest request, RequestTrans reqtrans, java.lang.String encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
parseParameters
public static void parseParameters(java.util.Map map, byte[] data, java.lang.String encoding, boolean isPost) throws java.io.UnsupportedEncodingException
Append request parameters from the specified String to the specified Map. It is presumed that the specified Map is not accessed from any other thread, so no synchronization is performed.IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter. NOTE: byte array data is modified by this method. Caller beware.
- Parameters:
map
- Map that accumulates the resulting parametersdata
- Input string containing request parametersencoding
- Encoding to use for converting hex- Throws:
java.io.UnsupportedEncodingException
- if the data is malformed
-
getServletInfo
public java.lang.String getServletInfo()
Return servlet info- Specified by:
getServletInfo
in interfacejavax.servlet.Servlet
- Overrides:
getServletInfo
in classjavax.servlet.GenericServlet
- Returns:
- the servlet info
-
-