|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.jcorporate.expresso.core.servlet.StdServlet
A Servlet base class adding some basic common functionality to the core HttpServlet class.
DBServlet,
Serialized Form| Field Summary | |
protected String |
mySchema
|
protected static String |
thisClass
|
| Constructor Summary | |
StdServlet()
|
|
| Method Summary | |
void |
destroy()
Called when the web context is destroyed or reloaded |
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Ancestor calls this function (with super.doGet) to handle making database connection, getting user login info and other common tasks. |
void |
doPost(HttpServletRequest req,
HttpServletResponse res)
Ancestor calls this method via super.doPost to handle standard operations. |
protected String |
getSchema()
Return the name of the schema class that this servlet is registered within |
protected String |
getServerName(HttpServletRequest request)
Return the name of the current web server system |
int |
getServerPort(HttpServletRequest request)
Return the port number the servlet runtime engine is running on |
String |
getServletPrefix(HttpServletRequest request)
Return a string to be used as part of the URL to call this servlet. |
String |
getServletPrefix(HttpServletRequest request,
String servlet)
|
String |
getString(HttpServletRequest req,
String stringCode)
Convenience method to request a localized message with no parameters |
String |
getString(HttpServletRequest req,
String stringCode,
Object[] args)
Pass on a call to retrieve an appropriate localized string from the correct Schema object |
String |
getTitle()
Ancestors of this class override this method to return a specific title that is used by the security administration Controllers to describe the servlet |
protected void |
handleParam(HttpServletRequest request,
HttpServletResponse response)
Handle the parameters to this servlet & set up standard information |
void |
init(ServletConfig sc)
Servlet initialization. |
protected void |
setSchema(String schemaClass)
Tell this StdServlet object what Schema it belongs to. |
protected void |
showError(String errorMessage,
HttpServletRequest request,
HttpServletResponse response)
Display an error to the user in a nicely formatted manner |
protected void |
showError(Throwable t,
HttpServletRequest request,
HttpServletResponse response)
Display a throwable (like an exception) to the user in a nicely formatted manner. |
| 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, 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 |
protected static final String thisClass
protected String mySchema
| Constructor Detail |
public StdServlet()
| Method Detail |
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
request - Standard request objectresponse - Standard response object
ServletException - If an uncaught exception occurs
IOException - If an I/O error occurs while communicating with
the client
public void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException,
IOException
req - Standard request objectres - Standard response object
ServletException - If an uncaught exception occurs
IOException - If an I/O error occurs while communicating with
the clientprotected String getServerName(HttpServletRequest request)
request -
public int getServerPort(HttpServletRequest request)
request -
public String getServletPrefix(HttpServletRequest request)
throws ServletException
request -
ServletException - If the string cannot be built due to
setup information not being available
public String getServletPrefix(HttpServletRequest request,
String servlet)
throws ServletException
request - servlet -
ServletExceptionpublic String getTitle()
protected void handleParam(HttpServletRequest request,
HttpServletResponse response)
throws IOException,
ServletException
request - Standard request objectresponse - Standard response object
IOException - If an I/O error occurs communicating with the client
ServletException - If an uncaught exception occurs
protected void showError(String errorMessage,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
errorMessage - Error messagerequest - response -
ServletException
protected void showError(Throwable t,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
t - The throwable errorrequest - response -
ServletException
public void init(ServletConfig sc)
throws ServletException
sc - The ServletConfig. Should contain 'configDir' as a context
parameter, and possibly 'logDir'.
ServletExceptionpublic void destroy()
protected void setSchema(String schemaClass)
schemaClass -
public String getString(HttpServletRequest req,
String stringCode,
Object[] args)
throws ServletException
req - stringCode - args -
ServletException
public String getString(HttpServletRequest req,
String stringCode)
throws ServletException
req - stringCode -
ServletExceptionprotected String getSchema()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||