Package helma.servlet
Class AbstractServletClient
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
helma.servlet.AbstractServletClient
- All Implemented Interfaces:
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Application
Abstract method to get theApplicaton
instance the servlet is talking to.Return servlet infovoid
init
(javax.servlet.ServletConfig init) Init this servlet.static void
parseParameters
(Map map, byte[] data, 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, String encoding) protected List
parseUploads
(org.apache.commons.fileupload.servlet.ServletRequestContext reqcx, RequestTrans reqtrans, UploadStatus uploadStatus, 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
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
-
Constructor Details
-
AbstractServletClient
public AbstractServletClient()
-
-
Method Details
-
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
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, IOException Handle a request.- Overrides:
service
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- ...response
- ...- Throws:
javax.servlet.ServletException
- ...IOException
- ...
-
writeResponse
protected void writeResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, RequestTrans hopreq, ResponseTrans hopres) throws IOException - Throws:
IOException
-
parseUploads
protected List parseUploads(org.apache.commons.fileupload.servlet.ServletRequestContext reqcx, RequestTrans reqtrans, UploadStatus uploadStatus, String encoding) throws org.apache.commons.fileupload.FileUploadException, UnsupportedEncodingException - Throws:
org.apache.commons.fileupload.FileUploadException
UnsupportedEncodingException
-
parseParameters
protected void parseParameters(javax.servlet.http.HttpServletRequest request, RequestTrans reqtrans, String encoding) throws IOException - Throws:
IOException
-
parseParameters
public static void parseParameters(Map map, byte[] data, String encoding, boolean isPost) throws 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:
UnsupportedEncodingException
- if the data is malformed
-
getServletInfo
Return servlet info- Specified by:
getServletInfo
in interfacejavax.servlet.Servlet
- Overrides:
getServletInfo
in classjavax.servlet.GenericServlet
- Returns:
- the servlet info
-