Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequestWrapper


          unauthorizedResponse = false;
          if (LOG.isDebugEnabled()) {
            LOG.debug("Request [{}] user [{}] authenticated", getRequestURL(httpRequest), token.getUserName());
          }
          final AuthenticationToken authToken = token;
          httpRequest = new HttpServletRequestWrapper(httpRequest) {

            @Override
            public String getAuthType() {
              return authToken.getType();
            }
View Full Code Here


    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
            ServletException {

        HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper((HttpServletRequest) request) {
            private UserBean getUserBean() {
                HttpSession session = getSession(false);
                if (session != null) {
                    return (UserBean) session.getAttribute("userBean");
                }
View Full Code Here

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

    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

    @Override
    public void doHandle(String target, Request baseRequest,
            HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        HttpServletRequest wrappedRequest = new HttpServletRequestWrapper(
                (HttpServletRequest) Proxy.newProxyInstance(
                    WebAppContextDashboard.class.getClassLoader(),
                    new Class[] { HttpServletRequest.class },
                    new PrivilegedInvoker(request)));
        IgnoreResponseErrors ignoreErr = new IgnoreResponseErrors(
View Full Code Here

        // Create the spoof request that can be used to dupe MCS into thinking
        // that the request was for the target URL (which it would have been
        // had the container implemented filters on RequestDispatcher#forward
        // invocations)
        HttpServletRequestWrapper requestWrapper =
                new HttpServletRequestWrapper(request) {
                    // javadoc inherited
                    public String getRequestURI() {
                        // Includes the query string
                        return contextPath + targetURL;
                    }
View Full Code Here

        // 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

    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

        currPathMethodValues.pathInfo = request.getPathInfo();
        currPathMethodValues.queryString = request.getQueryString();
        currPathMethodValues.requestURI = request.getRequestURI();
        if (dispatchDetection != DispatchDetection.CHECK_STATE)
        {           
            HttpServletRequestWrapper currentRequest = this;
            while ((currentRequest.getRequest()) instanceof HttpServletRequestWrapper)
            {
                requestWrapperStackSize++;
                currentRequest = (HttpServletRequestWrapper)currentRequest.getRequest();
            }
        }
    }
View Full Code Here

    }

    private HttpServletRequest wrapRequest(final HttpServletRequest request,
        final Locale locale)
    {
        return new HttpServletRequestWrapper(request)
        {
            /**
             * @see javax.servlet.ServletRequestWrapper#getLocale()
             */
            public Locale getLocale()
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpServletRequestWrapper

Copyright © 2018 www.massapicom. 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.