public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { if (pathInContext.equals(path)) { JettyEndpoint.this.handle(pathParams, request, response); request.setHandled(true); } } };
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { if (pathInContext.equals(path)) { JettyEndpoint.this.handle(pathParams, request, response); request.setHandled(true); } } };
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { if (pathInContext.equals(path)) { JettyEndpoint.this.handle(pathParams, request, response); request.setHandled(true); } } };
public void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse res) throws HttpException, IOException { if (!"/cachedContentTest".equals(pathInContext)) return; res.setField(HttpFields.__ContentType, "text/html"); setAlwaysCacheHeaders(res); OutputStreamWriter writer = new OutputStreamWriter(res.getOutputStream()); writer.write("<html><body>"); writer.write(Long.toString(System.currentTimeMillis())); writer.write("</body></html>"); writer.flush(); writer.close(); httpRequest.setHandled(true); }
public void handle( String string, String string1, HttpRequest httpRequest, HttpResponse httpResponse ) throws IOException { m_Logger.info( "Processing Request. (log4j)" ); m_JdkLogger.info( "Processing Request. (jdk)" ); m_JclLogger.info( "Processing Request. (jcl)" ); m_JuliLogger.info( "Processing Request. (juli)" ); m_Slf4jLogger.info( "Processing Request. (slf4j)" ); httpResponse.setContentType( "text/html" ); OutputStream outputStream = httpResponse.getOutputStream(); OutputStreamWriter osw = new OutputStreamWriter( outputStream, "UTF-8" ); PrintWriter out = new PrintWriter( osw ); out.print( "<html><body><h1>Hello, World!</h1></body></html>" ); out.flush(); httpRequest.setHandled( true ); }
/** Handles the HTTP request and generates the suite table */ public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { if (!pathInContext.startsWith("/singleTest/")) return; request.setHandled(true); String url = pathInContext.substring("/singleTest/".length()); OutputStream outStream = response.getOutputStream(); if (url == null) { outStream.write("No singleTest was specified!".getBytes()); outStream.flush(); return; } response.setContentType("text/html"); String suiteName = getSuiteName(url); Writer writer = new OutputStreamWriter(response.getOutputStream(), StringUtil.__ISO_8859_1); writer.write(MessageFormat.format(HTML, new Object[]{suiteName, url})); writer.flush(); }
public void handle(String pathInContext, String pathParams, HttpRequest req, HttpResponse resp) throws IOException { HTTPDecoupledClientInputStreamContext ctx = new HTTPDecoupledClientInputStreamContext(req); responseCallback.dispatch(ctx); resp.commit(); req.setHandled(true); } }
private void handleCommandRequest(HttpRequest req, HttpResponse res, String cmd, String sessionId) { final String results; // If this a Driver Client sending a new command... res.setContentType("text/plain"); hackRemoveConnectionCloseHeader(res); Vector<String> values = parseSeleneseParameters(req); results = doCommand(cmd, values, sessionId, res); // under some conditions, the results variable will be null // (cf http://forums.openqa.org/thread.jspa?threadID=2955&messageID=8085#8085 for an example of this) if (results!=null) { try { res.getOutputStream().write(results.getBytes("UTF-8")); } catch (IOException e) { e.printStackTrace(); } } req.setHandled(true); }
void serviceRequest(final HttpRequest req, final HttpResponse resp) throws IOException { try { if (LOG.isLoggable(Level.INFO)) { LOG.info("Service http request on thread: " + Thread.currentThread()); } HTTPServerInputStreamContext ctx = new HTTPServerInputStreamContext(this) { public void initContext() throws IOException { super.initContext(); inStream = req.getInputStream(); origInputStream = inStream; } }; BindingContextUtils.storeAsyncOnewayDispatch(ctx, true); ctx.put(HTTPServerInputStreamContext.HTTP_REQUEST, req); ctx.put(HTTPServerInputStreamContext.HTTP_RESPONSE, resp); ctx.initContext(); callback.dispatch(ctx, this); resp.commit(); req.setHandled(true); } finally { if (LOG.isLoggable(Level.INFO)) { LOG.info("Finished servicing http request on thread: " + Thread.currentThread()); } } }
protected void flushHeaders() throws IOException { if (response != null) { copyHeaders(context, response); response.setStatus(HttpURLConnection.HTTP_ACCEPTED, "Accepted"); response.commit(); request.setHandled(true); origOut.resetOut(new BufferedOutputStream(response.getOutputStream(), 1024)); } } }
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse res) throws HttpException, IOException { if (!"/postResults".equals(pathInContext)) return; request.setHandled(true); log.info("Received posted results"); String result = request.getParameter("result");
request.setHandled(true); if (proxy_in != null) { boolean injectableResponse = http.getResponseCode() == HttpURLConnection.HTTP_OK ||
req.setHandled(true); return; respond(res, sc, uniqueId); req.setHandled(true);
request.setHandled(false); return;
response.setContentLength(0); request.setHandled(true);
resp.sendRedirect(policy.getRedirectURL()); resp.commit(); req.setHandled(true); return; resp.getOutputStream().flush(); resp.commit(); req.setHandled(true); return; } catch (WSDLException ex) {
public void sendData(HttpRequest request, HttpResponse response, String pathInContext, Resource resource, boolean writeHeaders) throws IOException { if (!proxyInjectionMode) { super.sendData(request, response, pathInContext, resource, writeHeaders); return; } ResourceCache.ResourceMetaData metaData = (ResourceCache.ResourceMetaData) resource.getAssociate(); String mimeType = metaData.getMimeType(); response.setContentType(mimeType); if (resource.length() != -1) { response.setField(HttpFields.__ContentLength, metaData.getLength()); } InjectionHelper.injectJavaScript(request, response, resource.getInputStream(), response.getOutputStream(), debugURL); request.setHandled(true); }