use of org.apache.tapestry5.http.internal.services.ResponseImpl in project flowlogix by flowlogix.
the class GwtCachingFilter method service.
@Override
public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler chainHandler) throws IOException {
String path = request.getServletPath();
boolean neverExpire = checkConfig(path, response);
if (neverExpire == false) {
return chainHandler.service(request, response);
}
log.finer("GwtCachingFilter: Processing " + path);
Request rq = new RequestImpl(request, applicationCharset, sessionFactory);
Response rsp = new ResponseImpl(request, response);
rg.storeRequestResponse(rq, rsp);
rsp.setDateHeader("Expires", new Date().getTime() + InternalConstants.TEN_YEARS);
try {
return carh.handleAssetRequest(rq, rsp, pathProcessor.removeAssetPathPart(path));
} catch (Exception e) {
return chainHandler.service(request, response);
}
}
use of org.apache.tapestry5.http.internal.services.ResponseImpl in project tapestry-5 by apache.
the class ResponseImplTest method addHeader.
@Test
public void addHeader() {
final String HEADER_NAME = "Header-Name";
final String[] HEADER_VALUES = { "asdfasdf", "FHDFGH", "####" };
final HttpServletResponse httpServletResponse = mockHttpServletResponse();
final HttpServletRequest httpServletRequest = mockHttpServletRequest();
Response response = new ResponseImpl(httpServletRequest, httpServletResponse);
for (String value : HEADER_VALUES) {
httpServletResponse.addHeader(HEADER_NAME, value);
}
replay();
for (String value : HEADER_VALUES) {
response.addHeader(HEADER_NAME, value);
}
verify();
}
Aggregations