/** * Check and prepare the given request and response according to the settings * of this generator. * @see #checkRequest(HttpServletRequest) * @see #prepareResponse(HttpServletResponse) * @deprecated as of 4.2, since the {@code lastModified} flag is effectively ignored, * with a must-revalidate header only generated if explicitly configured */ @Deprecated protected final void checkAndPrepare( HttpServletRequest request, HttpServletResponse response, boolean lastModified) throws ServletException { checkRequest(request); prepareResponse(response); }
/** * Check and prepare the given request and response according to the settings * of this generator. * @see #checkRequest(HttpServletRequest) * @see #prepareResponse(HttpServletResponse) * @deprecated as of 4.2, since the {@code lastModified} flag is effectively ignored, * with a must-revalidate header only generated if explicitly configured */ @Deprecated protected final void checkAndPrepare( HttpServletRequest request, HttpServletResponse response, boolean lastModified) throws ServletException { checkRequest(request); prepareResponse(response); }
private void testVaryHeader(String[] configuredValues, String[] responseValues, String[] expected) { WebContentGenerator generator = new TestWebContentGenerator(); generator.setVaryByRequestHeaders(configuredValues); MockHttpServletResponse response = new MockHttpServletResponse(); for (String value : responseValues) { response.addHeader("Vary", value); } generator.prepareResponse(response); assertEquals(Arrays.asList(expected), response.getHeaderValues("Vary")); }
@Test public void varyHeaderNone() throws Exception { WebContentGenerator generator = new TestWebContentGenerator(); MockHttpServletResponse response = new MockHttpServletResponse(); generator.prepareResponse(response); assertNull(response.getHeader("Vary")); }
/** * @see #checkRequest(HttpServletRequest) * @see #applyCacheSeconds(HttpServletResponse, int) * @deprecated as of 4.2, since the {@code lastModified} flag is effectively ignored, * with a must-revalidate header only generated if explicitly configured */ @Deprecated protected final void checkAndPrepare( HttpServletRequest request, HttpServletResponse response, int cacheSeconds, boolean lastModified) throws ServletException { checkRequest(request); applyCacheSeconds(response, cacheSeconds); }