| org.vfny.geoserver.servlets.Dispatcher org.vfny.geoserver.wcs.servlets.WcsDispatcher
WcsDispatcher | public class WcsDispatcher extends Dispatcher (Code) | | Routes requests made at the top-level URI to appropriate interface servlet.
Note that the logic of this method could be generously described as
'loose.' It is not checking for request validity in any way (this is done
by the reqeust- specific servlets). Rather, it is attempting to make a
reasonable guess as to what servlet to call, given that the client is
routing to the top level URI as opposed to the request-specific URI, as
specified in the GetCapabilities response. Thus, this is a convenience
method, which allows for some slight client laziness and helps explain to
lost souls/spiders what lives at the URL. Due to the string parsing, it is
much faster (and recommended) to use the URIs specified in the
GetCapabablities response. Currently does not support post requests, but
most requests for this will likely come with get.
author: $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification) author: $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification) version: $Id: WcsDispatcher.java 7746 2007-11-13 15:38:35Z aaime $ |
doPost | public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code) | | This figures out a dispatched post request. It writes the request to a
temp file, and then reads it in twice from there. I found no other way
to do this, but this solution doesn't seem to bad. Obviously it is
better to use the servlets directly, without having to go through this
random file writing and reading. If our xml handlers were written more
dynamically this probably wouldn't be necessary, but it is. Hopefully
this should help GeoServer's interoperability with clients, since most
of them are kinda stupid, and can't handle different url locations for
the different requests.
Parameters: request - The servlet request object. Parameters: response - The servlet response object. throws: ServletException - For any servlet problems. throws: IOException - For any io problems. |
doResponse | protected void doResponse(Reader requestReader, HttpServletRequest request, HttpServletResponse response, int req_type) throws ServletException, IOException(Code) | | Does the actual response, creates the appropriate servlet to handle the
detected request. Note that the requestReader is a bit of a hack, if
it is null then it is from a get Request, if not then that means the
request is being stored as a file, and needs to be read with this
particular reader.
This does have the downside of forcing us to have doGet and doPost
methods of AbstractService be public, perhaps there is a good pattern
for handling this. Or we could try to re-write Dispatcher to extend
AbstractService, but it may be tricky.
Parameters: requestReader - The reader of a file that contains the request,null if from a get request. Parameters: request - The http request that was made. Parameters: response - The response to be returned. Parameters: req_type - The request type. throws: ServletException - for any problems. throws: IOException - If anything goes wrong reading or writing. |
|
|