All Packages Class Hierarchy This Package Previous Next Index
com.lgeds.jdf.servlet.JDFBaseServlet
protected static String lineSeparator
public JDFBaseServlet()
protected void doGet(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException
Servlet writers who override this method should read any data from the request, set entity headers in the response, access the writer or output stream, and, finally, write any response data. The headers that are set should include content type, and encoding. If a writer is to be used to write response data, the content type must be set before the writer is accessed. In general, the servlet implementor must write the headers before the response data because the headers can be flushed at any time after the data starts to be written.
Setting content length allows the servlet to take advantage of HTTP "connection keep alive". If content length can not be set in advance, the performance penalties associated with not using keep alives will sometimes be avoided if the response entity fits in an internal buffer.
Entity data written for a HEAD request is ignored. Servlet writers can, as a simple performance optimization, omit writing response data for HEAD methods. If no response data is to be written, then the content length field must be set explicitly.
The GET operation is expected to be safe: without any side effects for which users might be held responsible. For example, most form queries have no side effects. Requests intended to change stored data should use some other HTTP method. (There have been cases of significant security breaches reported because web-based applications used GET inappropriately.)
The GET operation is also expected to be idempotent: it can safely be repeated. This is not quite the same as being safe, but in some common examples the requirements have the same result. For example, repeating queries is both safe and idempotent (unless payment is required!), but buying something or modifying data is neither safe nor idempotent.
protected void doPost(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException
If HTTP/1.1 chunked encoding is used (that is, if the transfer-encoding header is present), then the content-length header should not be set. For HTTP/1.1 communications that do not use chunked encoding and HTTP 1.0 communications, setting content length allows the servlet to take advantage of HTTP "connection keep alive". For just such communications, if content length can not be set, the performance penalties associated with not using keep alives will sometimes be avoided if the response entity fits in an internal buffer.
This method does not need to be either "safe" or "idempotent". Operations requested through POST can have side effects for which the user can be held accountable. Specific examples including updating stored data or buying things online.
protected void performBasePreTask(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException
protected abstract void performPreTask(HttpServletRequest req,
HttpServletResponse res) throws Exception
protected void printHtmlPage(HttpServletRequest req,
HttpServletResponse res,
String location)
https://hostname/path/file.html).
Relative URLs are not permitted here.
protected void printJspPage(HttpServletRequest req,
HttpServletResponse res,
String jspfile)
/example/result.jsp).
Relative URLs are not permitted here.
protected void printMessagePage(HttpServletRequest req,
HttpServletResponse res,
Message msg)
protected void printMessagePage(HttpServletRequest req,
HttpServletResponse res,
Message user_msg,
Exception e)
protected void printMessagePage(HttpServletRequest req,
HttpServletResponse res,
Message user_msg,
String debug_msg)
protected void printMessagePage(HttpServletRequest req,
HttpServletResponse res,
String msg)
protected void printMessagePage(HttpServletRequest req,
HttpServletResponse res,
String user_msg,
Exception e)
protected abstract void printMessagePage(HttpServletRequest req,
HttpServletResponse res,
String user_msg,
String debug_msg)
protected void printPopupMessagePage(HttpServletRequest req,
HttpServletResponse res,
Message msg)
protected void printPopupMessagePage(HttpServletRequest req,
HttpServletResponse res,
Message user_msg,
Exception e)
protected void printPopupMessagePage(HttpServletRequest req,
HttpServletResponse res,
Message user_msg,
String debug_msg)
protected void printPopupMessagePage(HttpServletRequest req,
HttpServletResponse res,
String msg)
protected void printPopupMessagePage(HttpServletRequest req,
HttpServletResponse res,
String user_msg,
Exception e)
protected abstract void printPopupMessagePage(HttpServletRequest req,
HttpServletResponse res,
String user_msg,
String debug_msg)
All Packages Class Hierarchy This Package Previous Next Index