public ResteasyRequestWrapper(final HttpServletRequest request, final String httpMethod, final String prefix) throws ServletException, IOException { this.httpServletRequest = request; ResteasyHttpHeaders headers = ServletUtil.extractHttpHeaders(request); ResteasyUriInfo uriInfo = ServletUtil.extractUriInfo(request, prefix); // TODO: how are we supposed to get the response to create the // wrapper!!!!? The null response will only make it so that the // Asynchronous invocations won't work // HttpServletResponseWrapper theResponse = new // HttpServletResponseWrapper(httpServletResponse, dispatcher // TODO: the two nulls are the response and the dispatcher. Those // are not needed here... They are only needed for asynchronous // invocations. Suggest Core RESTEasy refactoring to change the // async invocation httpRequest = new HttpServletInputMessage(request, null, null, null, headers, uriInfo, httpMethod .toUpperCase(), null); }
public static ResteasyHttpHeaders extractHttpHeaders(HttpServletRequest request) { MultivaluedMap<String, String> requestHeaders = extractRequestHeaders(request); ResteasyHttpHeaders headers = new ResteasyHttpHeaders(requestHeaders); String contentType = request.getContentType(); if (contentType != null) headers.getMutableHeaders().putSingle(HttpHeaders.CONTENT_TYPE, contentType); Map<String, Cookie> cookies = extractCookies(request); headers.setCookies(cookies); // test parsing should throw an exception on error headers.testParsing(); return headers; }
@Produces @RequestScoped @JaxRsQualifier public UriInfo getUriInfo() { return ServletUtil.extractUriInfo(getHttpServletRequest(), ""); }
public RequestImpl(HttpServletRequest request, HttpServletResponse response) { this.headers = ServletUtil.extractHttpHeaders(request); this.httpMethod = request.getMethod().toUpperCase(); this.request = request; this.response = response; }
public static HttpHeaders extractHttpHeaders(HttpServletRequest request) { HttpHeadersImpl headers = new HttpHeadersImpl(); MultivaluedMap<String, String> requestHeaders = extractRequestHeaders(request); headers.setRequestHeaders(requestHeaders); List<MediaType> acceptableMediaTypes = extractAccepts(requestHeaders); List<String> acceptableLanguages = extractLanguages(requestHeaders); headers.setAcceptableMediaTypes(acceptableMediaTypes); headers.setAcceptableLanguages(acceptableLanguages); headers.setLanguage(requestHeaders.getFirst(HttpHeaderNames.CONTENT_LANGUAGE)); String contentType = request.getContentType(); if (contentType != null) headers.setMediaType(MediaType.valueOf(contentType)); Map<String, Cookie> cookies = extractCookies(request); headers.setCookies(cookies); return headers; }
@Produces @RequestScoped @JaxRsQualifier public UriInfo getUriInfo() { return ServletUtil.extractUriInfo(getHttpServletRequest(), ""); }
public RequestImpl(HttpServletRequest request, HttpServletResponse response) { this.headers = ServletUtil.extractHttpHeaders(request); this.httpMethod = request.getMethod().toUpperCase(); this.request = request; this.response = response; }
try headers = ServletUtil.extractHttpHeaders(request); uriInfo = ServletUtil.extractUriInfo(request, servletMappingPrefix);
@Produces @RequestScoped @JaxRsQualifier public UriInfo getUriInfo() { return ServletUtil.extractUriInfo(getHttpServletRequest(), ""); }
public RequestImpl(HttpServletRequest request, HttpServletResponse response) { this.headers = ServletUtil.extractHttpHeaders(request); this.httpMethod = request.getMethod().toUpperCase(); this.request = request; this.response = response; }
public static ResteasyHttpHeaders extractHttpHeaders(HttpServletRequest request) { MultivaluedMap<String, String> requestHeaders = extractRequestHeaders(request); ResteasyHttpHeaders headers = new ResteasyHttpHeaders(requestHeaders); String contentType = request.getContentType(); if (contentType != null) headers.getMutableHeaders().putSingle(HttpHeaders.CONTENT_TYPE, contentType); Map<String, Cookie> cookies = extractCookies(request); headers.setCookies(cookies); // test parsing should throw an exception on error headers.testParsing(); return headers; }
try headers = ServletUtil.extractHttpHeaders(request); uriInfo = ServletUtil.extractUriInfo(request, servletMappingPrefix);
@Produces @RequestScoped @JaxRsQualifier public UriInfo getUriInfo() { return ServletUtil.extractUriInfo(getHttpServletRequest(), ""); }
@Produces @RequestScoped @JaxRsQualifier public HttpHeaders getHttpHeaders() { return ServletUtil.extractHttpHeaders(getHttpServletRequest()); }
public static ResteasyHttpHeaders extractHttpHeaders(HttpServletRequest request) { MultivaluedMap<String, String> requestHeaders = extractRequestHeaders(request); ResteasyHttpHeaders headers = new ResteasyHttpHeaders(requestHeaders); String contentType = request.getContentType(); if (contentType != null) headers.getMutableHeaders().putSingle(HttpHeaders.CONTENT_TYPE, contentType); Map<String, Cookie> cookies = extractCookies(request); headers.setCookies(cookies); // test parsing should throw an exception on error headers.testParsing(); return headers; }
try headers = ServletUtil.extractHttpHeaders(request); uriInfo = ServletUtil.extractUriInfo(request, servletMappingPrefix);
return ServletUtil.extractUriInfo(request, mappingPrefix);
@Produces @RequestScoped @JaxRsQualifier public HttpHeaders getHttpHeaders() { return ServletUtil.extractHttpHeaders(getHttpServletRequest()); }
try headers = ServletUtil.extractHttpHeaders(request); uriInfo = ServletUtil.extractUriInfo(request, servletMappingPrefix);
protected void redirectToWelcomePage(Request request, HttpServletResponse response) throws IOException { ResteasyUriInfo uriInfo = ServletUtil.extractUriInfo(request, null); String[] welcomes = context.findWelcomeFiles(); if (welcomes.length > 0) { UriBuilder welcome = uriInfo.getBaseUriBuilder().path(welcomes[0]); response.sendRedirect(welcome.toTemplate()); } else { response.setStatus(204); } }