|
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.util.http.HttpProtectedServlet
Provides an abstract class for protected servlets.
Protcted servlets are those that require that the requester has been authenticated and authorised, and has thereby established a session. This class has to deal with two distinct outcomes, in response to a request to a protected servlet:
doGetDispatch(com.opmath.util.http.HttpServletRequest)
or doPostDispatch(com.opmath.util.http.HttpServletRequest) method
can be invoked.WARNING: It is up to the programmer to ensure that the use of the HttpSession
instance variable (or any other instance variable) has thread safety.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
HttpServlet,
HttpSessionServlet,
HttpLogOnServlet,
HttpLogOffServlet, Serialized Form| Fields inherited from class com.opmath.util.http.HttpServlet |
EOL, LOGON_DONE, LOGON_TARGET |
| Constructor Summary | |
HttpProtectedServlet()
|
|
| Method Summary | |
void |
doGet(HttpServletRequest req,
HttpServletResponse rsp)
Handles an HTTP GET request. |
protected String |
doGetDispatch(HttpServletRequest req)
Services an HTTP GET request, as handled by the doGet(HttpServletRequest, HttpServletResponse) method on this
class. |
void |
doPost(HttpServletRequest req,
HttpServletResponse rsp)
Handles an HTTP POST request. |
protected String |
doPostDispatch(HttpServletRequest req)
Services an HTTP POST request, as handled by the doPost(HttpServletRequest, HttpServletResponse) method on this
class. |
String |
getServletInfo()
Returns a String carrying some information about the servlet. |
protected String |
protectedRedirectURI()
Returns the URI of the resource that provides a log on function. |
| Methods inherited from class com.opmath.util.http.HttpServlet |
getIndex, getParamIndex, getValueCount, paramIndices, paramMappings, paramNames, paramValues, registerIndex, registerIndices, report, setConfig, setConfig |
| Methods inherited from class javax.servlet.http.HttpServlet |
|
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.opmath.util.http.ParamIndex |
getIndex, getParamIndex, getValueCount, paramIndices, paramMappings, paramNames, paramValues, registerIndex |
| Constructor Detail |
public HttpProtectedServlet()
| Method Detail |
protected String protectedRedirectURI()
Returns the URI of the resource that provides a log on function. Invoked when an attempt is made to access a protected servlet, by a requester that does not have a current session.
The URI String returned is "/logon".
String carrying the default redirection URI.
public final void doGet(HttpServletRequest req,
HttpServletResponse rsp)
throws ServletException,
IOException
Handles an HTTP GET request.
This method will either redirect the requester to the log on resource, or hand
over to the appropriate doGetDispatch(com.opmath.util.http.HttpServletRequest)
method.
Specified as final to maintain security.
doGet in class HttpServletreq - an HttpServletRequest object
that contains the request the client has made of the servlet.rsp - an HttpServletResponse object that
contains the response the servlet sends to the client.ServletException - an exception thrown if the request
could not be handled.IOException - an exception thrown if an input or output
error is detected when the servlet handles the GET request.doGetDispatch(com.opmath.util.http.HttpServletRequest)
protected String doGetDispatch(HttpServletRequest req)
throws Exception
Services an HTTP GET request, as handled by the
doGet(HttpServletRequest, HttpServletResponse) method on this
class. This method should be overriden by any real-world application.
doGetDispatch in class HttpServletreq - an com.opmath.util.http.HttpServletRequest
created by doGet(HttpServletRequest, HttpServletResponse).String carrying the report.Exception - if a subclass's method encounters any error state.doGet(HttpServletRequest, HttpServletResponse)
public final void doPost(HttpServletRequest req,
HttpServletResponse rsp)
throws ServletException,
IOException
Handles an HTTP POST request.
This method will either redirect the requester to the log on resource, or hand
over to the appropriate doPostDispatch(com.opmath.util.http.HttpServletRequest)
method.
Specified as final to maintain security.
doPost in class HttpServletreq - an HttpServletRequest object
that contains the request the client has made of the servlet.rsp - an HttpServletResponse object that
contains the response the servlet sends to the client.ServletException - an exception thrown if the request
could not be handled.IOException - an exception thrown if an input or output
error is detected when the servlet handles the POST request.doPostDispatch(com.opmath.util.http.HttpServletRequest)
protected String doPostDispatch(HttpServletRequest req)
throws Exception
Services an HTTP POST request, as handled by the
doPost(HttpServletRequest, HttpServletResponse) method on this
class. This method should be overriden by any real-world application.
doPostDispatch in class HttpServletreq - an com.opmath.util.http.HttpServletRequest
created by doGet(HttpServletRequest, HttpServletResponse).String carrying the report.Exception - if a subclass's method encounters any error state.doPost(HttpServletRequest, HttpServletResponse)public String getServletInfo()
String carrying some information about the servlet. This method should be
overridden by any subclass.
getServletInfo in class HttpServletString describing the class.
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||