| org.gomba.TransactorAbstractServlet org.gomba.AbstractServlet org.gomba.SingleQueryServlet
All known Subclasses: org.gomba.LOBUpdateServlet, org.gomba.DatumServlet, org.gomba.XMLServlet,
SingleQueryServlet | abstract public class SingleQueryServlet extends AbstractServlet (Code) | | Base class for servlets that perform a SELECT and render the results to the
HTTP response body.
Init params:
- query
- The SQL query to execute. May contain ${} parameters. This init-param
also accepts a path to a dynamic resource (a JSP) when dynamic SQL generation
is needed. The path must begin with a "/" and is interpreted as relative to
the current context root. (Required)
- skip
- The number of records to skip. May contain ${} parameters. (Optional)
- max
- The maximum number of records to load. May contain ${} parameters.
(Optional)
- nodata-http-status
- The HTTP status code in case of empty resultset. If the code is 200 (OK)
then the subclassing servlet will output its default value. Defaults to 200
(OK). A useful code is 404 (Not found). (Optional)
- nodata-default-resource
- Path to a resource to serve in case of empty resultset. The path must
begin with a "/" and is interpreted as relative to the current context root.
When this init-param is not specified, the subclassing servlet default output
is used. (Optional)
author: Flavio Tordini version: $Id: SingleQueryServlet.java,v 1.5 2005/10/19 13:48:16 flaviotordini Exp $ |
doDefaultOutput | protected void doDefaultOutput(HttpServletResponse response) throws Exception(Code) | | Render a default value when the resultset is empty (0 rows).
Parameters: response - The HTTP response to write to |
doInput | protected void doInput(ResultSet resultSet, HttpServletRequest request, ParameterResolver parameterResolver, Connection connection) throws Exception(Code) | | Override this method in order to process data from the request body. The
contract for subclasses is not to close the ResultSet and not to call
ResultSet.next().
Parameters: resultSet - The resultset, may be null. Parameters: request - The HTTP request to read from Parameters: parameterResolver - The object used to resolve parameters. |
doOutput | protected void doOutput(ResultSet resultSet, HttpServletResponse response, ParameterResolver parameterResolver) throws Exception(Code) | | Render the content of the resultset in the response body. The contract
for subclasses is not to close the ResultSet and expect it to be
positioned on the first row to render (This means ResultSet.next() should
be called after the first row has been rendered.
Parameters: resultSet - The resultset to render Parameters: response - The HTTP response to write to Parameters: parameterResolver - The object used to resolve parameters. |
|
|