/** @see javax.servlet.http.HttpServletResponse#setHeader(java.lang.String, java.lang.String) */ public void setHeader(String arg0, String arg1) { addHeader(arg0, arg1); }
/** * Dispatches a request to the GeoServer OWS {@link Dispatcher} * * @param params * the KVP map of OWS parameters * @param cookies * @return an http response wrapper where to grab the raw dispatcher response from * @throws Exception */ public Resource dispatchOwsRequest(final Map<String, String> params, Cookie[] cookies) throws Exception { FakeHttpServletRequest req = new FakeHttpServletRequest(params, cookies); FakeHttpServletResponse resp = new FakeHttpServletResponse(); owsDispatcher.handleRequest(req, resp); return new ByteArrayResource(resp.getBytes()); }
/** * Dispatches a request to the GeoServer OWS {@link Dispatcher} * * @param params the KVP map of OWS parameters * @param cookies * @return an http response wrapper where to grab the raw dispatcher response from */ public Resource dispatchOwsRequest(final Map<String, String> params, Cookie[] cookies) throws Exception { // If the WORKSPACE parameter is set, remove it and use it to set the workspace of the // request String workspace = params.remove(WORKSPACE_PARAM); FakeHttpServletRequest req = new FakeHttpServletRequest(params, cookies, workspace); FakeHttpServletResponse resp = new FakeHttpServletResponse(); Request request = Dispatcher.REQUEST.get(); Dispatcher.REQUEST.remove(); try { owsDispatcher.handleRequest(req, resp); } finally { // reset the old request if (request != null) { Dispatcher.REQUEST.set(request); } else { Dispatcher.REQUEST.remove(); } } return new ByteArrayResource(resp.getBytes()); }
/** * @see javax.servlet.http.HttpServletResponse#setHeader(java.lang.String, java.lang.String) */ public void setHeader(String arg0, String arg1) { addHeader(arg0, arg1); }