/** * @return value of content-type header */ public String getContentType() { return getHeader("Content-Type"); }
public String getContentType() { return getHeader("Content-Type"); }
/** * Retrieves the content disposition from the response header. * * @return the content disposition from the response header */ public String getContentDispositionFromResponseHeader() { return ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Content-Disposition"); }
/** * Retrieves the last-modified value from the response header. * * @return the last-modified value from the response header */ public String getLastModifiedFromResponseHeader() { return ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Last-Modified"); }
/** * Retrieves the content disposition from the response header. * * @return the content disposition from the response header */ public String getContentDispositionFromResponseHeader() { return ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Content-Disposition"); }
/** * Retrieves the last-modified value from the response header. * * @return the last-modified value from the response header */ public String getLastModifiedFromResponseHeader() { return ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Last-Modified"); }
/** * Retrieves the content length from the response header. * * @return the content length from the response header */ public int getContentLengthFromResponseHeader() { String contentLength = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Content-Length"); if (contentLength == null) { throw new WicketRuntimeException("No Content-Length header found"); } return Integer.parseInt(contentLength); }
/** * Retrieves the content length from the response header. * * @return the content length from the response header */ public int getContentLengthFromResponseHeader() { String contentLength = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Content-Length"); if (contentLength == null) { throw new WicketRuntimeException("No Content-Length header found"); } return Integer.parseInt(contentLength); }
/** * Retrieves the content type from the response header. * * @return the content type from the response header */ public String getContentTypeFromResponseHeader() { String contentType = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Content-Type"); if (contentType == null) { throw new WicketRuntimeException("No Content-Type header found"); } return contentType; }
/** * Retrieves the content type from the response header. * * @return the content type from the response header */ public String getContentTypeFromResponseHeader() { String contentType = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Content-Type"); if (contentType == null) { throw new WicketRuntimeException("No Content-Type header found"); } return contentType; }
/** * Asserts that the Ajax location header is present. */ public void assertAjaxLocation() { if (null != ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getRedirectLocation()) { throw new AssertionFailedError( "Location header should *not* be present when using Ajax"); } String ajaxLocation = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Ajax-Location"); if (null == ajaxLocation) { throw new AssertionFailedError("Ajax-Location header should be present when using Ajax"); } int statusCode = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getStatus(); if (statusCode != 200) { throw new AssertionFailedError("Expected HTTP status code to be 200 (OK)"); } }
/** * Asserts that the Ajax location header is present. */ public void assertAjaxLocation() { if (null != ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getRedirectLocation()) { throw new AssertionFailedError( "Location header should *not* be present when using Ajax"); } String ajaxLocation = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getHeader("Ajax-Location"); if (null == ajaxLocation) { throw new AssertionFailedError("Ajax-Location header should be present when using Ajax"); } int statusCode = ((MockHttpServletResponse)getWicketResponse().getHttpServletResponse()).getStatus(); if (statusCode != 200) { throw new AssertionFailedError("Expected HTTP status code to be 200 (OK)"); } }
String url = httpResponse.getHeader("Ajax-Location"); if (url != null)