public void respond(RequestCycle requestCycle) { final WebResponse response = (WebResponse) requestCycle.getResponse(); final Application app = Application.get(); final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding(); response.setCharacterEncoding(encoding); response.setContentType("text/xml; charset=" + encoding); // Make sure it is not cached by a client response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Pragma", "no-cache"); response.write("<?xml version=\"1.0\" encoding=\""); response.write(encoding); response.write("\"?>"); response.write("<ajax-response>"); response.write(responseText); response.write("</ajax-response>"); }
public void respond(RequestCycle requestCycle) { final WebResponse response = (WebResponse) requestCycle.getResponse(); final Application app = Application.get(); final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding(); response.setCharacterEncoding(encoding); response.setContentType("text/xml; charset=" + encoding); // Make sure it is not cached by a client response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Pragma", "no-cache"); response.write("<?xml version=\"1.0\" encoding=\""); response.write(encoding); response.write("\"?>"); response.write("<ajax-response>"); response.write(responseText); response.write("</ajax-response>"); }
write((AppendingStringBuffer)string);
write((AppendingStringBuffer)string);
/** * Flushes the response buffer by doing a redirect or writing out the buffer. NOTE: The servlet * container will close the response output stream. */ public void close() { // If a redirection was specified if (redirectURL != null) { // actually redirect super.redirect(redirectURL); } else { // Write the buffer to the response stream if (buffer.length() != 0) { super.write(buffer); } } }
/** * Flushes the response buffer by doing a redirect or writing out the buffer. NOTE: The servlet * container will close the response output stream. */ @Override public void close() { // If a redirection was specified if (redirectURL != null) { // actually redirect super.redirect(redirectURL); } else { // Write the buffer to the response stream if (buffer.length() != 0) { super.write(buffer); } } }
/** * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle) */ public void respond(RequestCycle requestCycle) { WebResponse response = (WebResponse)requestCycle.getResponse(); final String encoding = Application.get() .getRequestCycleSettings() .getResponseRequestEncoding(); // Set content type based on markup type for page response.setCharacterEncoding(encoding); response.setContentType("text/xml; charset=" + encoding); // Make sure it is not cached by a client response.setDateHeader("Expires", System.currentTimeMillis()); response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Pragma", "no-cache"); response.write("<?xml version=\"1.0\" encoding=\""); response.write(encoding); response.write("\"?><ajax-response></ajax-response>"); }
response.write(fis); } catch (FileNotFoundException e) { log.error("Tempfile missing during export", e);
response.write(fis); } catch (FileNotFoundException e) { log.error("Tempfile missing during export", e);
/** * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle) */ public void respond(RequestCycle requestCycle) { final Application app = Application.get(); // Determine encoding final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding(); // Set content type based on markup type for page final WebResponse response = (WebResponse) requestCycle.getResponse(); response.setCharacterEncoding(encoding); response.setContentType("text/plain; charset=" + encoding); // Make sure it is not cached by a client response.setHeader("Expires", Time.now().subtract(Duration.minutes(1)).toDateString()); response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Pragma", "no-cache"); response.setLastModifiedTime(Time.now()); // set filename response.setAttachmentHeader(getFilename()); response.write(getContent()); }