|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--com.opmath.util.http.HttpServlet
|
+--com.opmath.test.dmldoc.UploadServlet
Example - a Servlet making use of DMLDoc and Jakarta Tomcat: File upload utility. Demonstrates the use of DMLDoc, as contained within Open Math Utilities v010 with Jakarta Tomcat 4.0 / Servlet 2.3 API.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Field Summary | |
static String |
IMG_DIR
The absolute local file path for uploaded images. |
static String |
IMG_REF
The relative location of uploaded images. |
static String |
TPL_DIR
The absolute local file path to the HTML templates used by the servlet. |
| Fields inherited from class com.opmath.util.http.HttpServlet |
EOL, LOGON_DONE, LOGON_TARGET |
| Constructor Summary | |
UploadServlet()
|
|
| Method Summary | |
void |
destroy()
Release the servlet's resources, including the mail client. |
String |
doGetDispatch(HttpServletRequest req)
Respond to an HTTP GET request. |
String |
doPostDispatch(HttpServletRequest req)
Respond to an HTTP POST request. |
String |
getServletInfo()
Reports a summary of the servlet's identity. |
void |
init()
Initialise the servlet. |
| Methods inherited from class com.opmath.util.http.HttpServlet |
|
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static String TPL_DIR
The absolute local file path to the HTML templates used by the servlet. Should be initialised using web.xml.
public static String IMG_DIR
The absolute local file path for uploaded images. Should be initialised using web.xml.
public static String IMG_REF
The relative location of uploaded images. Should be initialised using web.xml.
| Constructor Detail |
public UploadServlet()
| Method Detail |
public void init()
throws ServletException,
UnavailableException
Initialise the servlet. Involked only by the servlet container.
init in class GenericServletServletException - not explicitly thrown within this method.UnavailableException - if the servlet could not be initialised.
public String doGetDispatch(HttpServletRequest req)
throws Exception
Respond to an HTTP GET request.
Involked by doGet(..) on the servlet's superclass.
In this case, the servlet is responding to a GET request for the upload request form.
doGetDispatch in class HttpServletrequest - a com.opmath.util.http.HttpServletRequest instantiated
by the container.Exception - if the request could not be satisfied.
public String doPostDispatch(HttpServletRequest req)
throws Exception
Respond to an HTTP POST request.
Involked by doPost(..) on the servlet's superclass.
In this case, the servlet is responding to a POST request carrying the uploaded data, and requesting the response form.
doPostDispatch in class HttpServletrequest - a com.opmath.util.http.HttpServletRequest instantiated
by the container.Exception - if the request could not be satisfied.public void destroy()
Release the servlet's resources, including the mail client. (Involked only by the servlet container.)
destroy in class GenericServletpublic String getServletInfo()
Reports a summary of the servlet's identity.
getServletInfo in class HttpServletString describing this servlet.
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||