Examples of HttpServletRequestWrapper


Examples of javax.servlet.http.HttpServletRequestWrapper

    @Override
    public void doFilter(ServletRequest request,
                         ServletResponse response,
                         FilterChain chain
                         ) throws IOException, ServletException {
      HttpServletRequestWrapper quoted =
        new RequestQuoter((HttpServletRequest) request);
      final HttpServletResponse httpResponse = (HttpServletResponse) response;

      // Infer the content type based on the path of the request.
      String path = ((HttpServletRequest)request).getRequestURI();
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

            BaseServerWebSocket webSocket = BaseServerWebSocket.class.cast(w);

            webSocketProcessor = new WebSocketProcessor(config.getServlet(), new GrizzlyWebSocketSupport(webSocket));
            try {
                webSocketProcessor.connect(new HttpServletRequestWrapper(webSocket.getRequest()){
                      public String getServletPath() {
                          return servletPath;
                      }
                });
            } catch (IOException e) {
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

    @Override
    public void doFilter(ServletRequest request,
                         ServletResponse response,
                         FilterChain chain
                         ) throws IOException, ServletException {
      HttpServletRequestWrapper quoted =
        new RequestQuoter((HttpServletRequest) request);
      HttpServletResponse httpResponse = (HttpServletResponse) response;

      String mime = inferMimeType(request);
      if (mime == null) {
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

     *
     * @param request
     * @return
     */
    private HttpServletRequest createRequestWrapper(ServletRequest request) {
        HttpServletRequest requestWrapper = new HttpServletRequestWrapper((HttpServletRequest)request) {
           
            @Override
            public String getServletPath() {
                return servletPath;
            }
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

        // save stuff on attributes
        setAttribute(HttpServletRequest.class, servletRequest);

        // note that a HttpServlet*Wrapper is needed for injection of
        // singletons that had a @Context HttpServlet*; see [WINK-73]
        setAttribute(HttpServletRequestWrapper.class, new HttpServletRequestWrapper(servletRequest));
        HttpServletResponseWrapper responseWrapper =
            new WrappedResponse(servletRequest, servletResponse, configuration.getMediaTypeMapper());
        setAttribute(HttpServletResponse.class, responseWrapper);
        setAttribute(HttpServletResponseWrapper.class, responseWrapper);
        setAttribute(ServletContext.class, configuration.getServletContext());
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

    public CxfRsHttpListener(HTTPTransportFactory httpTransportFactory) {
        transportFactory = httpTransportFactory;
    }

    @Override public void onMessage(final HttpRequest httpRequest, final HttpResponse httpResponse) throws Exception {
        destination.invoke(null, httpRequest.getServletContext(), new HttpServletRequestWrapper(httpRequest) {
            // see org.apache.cxf.jaxrs.utils.HttpUtils.getPathToMatch()
            // cxf uses implicitly getRawPath() from the endpoint but not for the request URI
            // so without stripping the address until the context the behavior is weird
            // this is just a workaround waiting for something better
            @Override public String getRequestURI() {
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

        RuntimeContext context = RuntimeContextTLS.getRuntimeContext();
        if (context == null) {
            throw new IllegalStateException();
        }

        HttpServletRequestWrapper wrapper =
            RuntimeContextTLS.getRuntimeContext().getAttribute(HttpServletRequestWrapper.class);
        if (wrapper == null) {
            throw new IllegalStateException();
        }
        return wrapper;
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

    String filterPath = WebApplication.get()
      .getWicketFilter()
      .getFilterConfig()
      .getInitParameter(WicketFilter.FILTER_MAPPING_PARAM);
    filterPath = filterPath.substring(1, filterPath.length() - 1);
    HttpServletRequest httpRequest = new HttpServletRequestWrapper(resource.getRequest())
    {
      @Override
      public String getContextPath()
      {
        String ret = super.getContextPath();
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

        // save stuff on attributes
        setAttribute(HttpServletRequest.class, servletRequest);

        // note that a HttpServlet*Wrapper is needed for injection of
        // singletons that had a @Context HttpServlet*; see [WINK-73]
        setAttribute(HttpServletRequestWrapper.class, new HttpServletRequestWrapper(servletRequest));
        HttpServletResponseWrapper responseWrapper =
            new WrappedResponse(servletRequest, servletResponse, configuration.getMediaTypeMapper());
        setAttribute(HttpServletResponse.class, responseWrapper);
        setAttribute(HttpServletResponseWrapper.class, responseWrapper);
        setAttribute(ServletContext.class, configuration.getServletContext());
View Full Code Here

Examples of javax.servlet.http.HttpServletRequestWrapper

        return new RouteContext(errorRoute, wrapRequest(orgContext), orgContext.getResponse(), orgContext.getRoutes());
    }
   
    private HttpServletRequest wrapRequest(final RouteContext routeContext) {
        final String acceptAny = appendAnyMediaTypeToAcceptHeader(routeContext.getRequest());
        return new HttpServletRequestWrapper(routeContext.getRequest()) {
            @Override
            public String getHeader(final String name) {
                if (name.equalsIgnoreCase("accept")) {
                    return acceptAny;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.