Package javax.servlet

Examples of javax.servlet.ServletRequestWrapper


                throws ServletException, IOException {
            if (DispatcherType.ASYNC != req.getDispatcherType()) {
                AsyncContext asyncContext;
                if ("y".equals(req.getParameter(CUSTOM_REQ_RESP))) {
                    asyncContext = req.startAsync(
                            new ServletRequestWrapper(req),
                            new ServletResponseWrapper(resp));
                } else {
                    asyncContext = req.startAsync();
                }
                if ("y".equals(req.getParameter(EMPTY_DISPATCH))) {
View Full Code Here


            RequestDispatcher dispatcher = null;

            if(request.getParameter("include")!=null)
            {
                dispatcher = getServletContext().getRequestDispatcher(request.getParameter("include"));
                dispatcher.include(new ServletRequestWrapper(request), new ServletResponseWrapper(response));
            }
            else if(request.getParameter("forward")!=null)
            {
                dispatcher = getServletContext().getRequestDispatcher(request.getParameter("forward"));
                if (dispatcher!=null)
                    dispatcher.forward(new ServletRequestWrapper(request), new ServletResponseWrapper(response));
                else
                    response.sendError(404);
            }

        }
View Full Code Here

                throws ServletException, IOException {
            if (DispatcherType.ASYNC != req.getDispatcherType()) {
                AsyncContext asyncContext;
                if ("y".equals(req.getParameter(CUSTOM_REQ_RESP))) {
                    asyncContext = req.startAsync(
                            new ServletRequestWrapper(req),
                            new ServletResponseWrapper(resp));
                } else {
                    asyncContext = req.startAsync();
                }
                if ("y".equals(req.getParameter(EMPTY_DISPATCH))) {
View Full Code Here

                throws ServletException, IOException {
            if (DispatcherType.ASYNC != req.getDispatcherType()) {
                AsyncContext asyncContext;
                if ("y".equals(req.getParameter(CUSTOM_REQ_RESP))) {
                    asyncContext = req.startAsync(
                            new ServletRequestWrapper(req),
                            new ServletResponseWrapper(resp));
                } else {
                    asyncContext = req.startAsync();
                }
                if ("y".equals(req.getParameter(EMPTY_DISPATCH))) {
View Full Code Here

    {
        while (!(request instanceof ServletHttpRequest))
        {
            if (request instanceof ServletRequestWrapper)
            {
                ServletRequestWrapper wrapper =
                    (ServletRequestWrapper)request;
                request=wrapper.getRequest();
            }
            else
                throw new IllegalArgumentException("Does not wrap ServletHttpRequest");
        }
View Full Code Here

         {
            return (DispatchedHttpServletRequest)wrapped;
         }
         else if (wrapped instanceof ServletRequestWrapper)
         {
            ServletRequestWrapper wrapper = (ServletRequestWrapper)wrapped;
            wrapped = wrapper.getRequest();
         }
         else
         {
            throw new IllegalArgumentException();
         }
View Full Code Here

         {
            return (DispatchedHttpServletRequest)wrapped;
         }
         else if (wrapped instanceof ServletRequestWrapper)
         {
            ServletRequestWrapper wrapper = (ServletRequestWrapper)wrapped;
            wrapped = wrapper.getRequest();
         }
         else
         {
            throw new IllegalArgumentException();
         }
View Full Code Here

    assertSame(res, chain.getResponse());
  }

  /** Test no logging if request is not HttpServletRequest. */
  public void testNotHttpServletRequest() throws Exception {
    ServletRequest request = new ServletRequestWrapper(req);
    ServletResponse response = new ServletResponseWrapper(res);
    logger.setLevel(Level.FINEST);
    filter.doFilter(request, response, chain);
    assertEquals("", handler.toString());
    assertSame(request, chain.getRequest());
View Full Code Here

    {
        while (!(request instanceof ServletHttpRequest))
        {
            if (request instanceof ServletRequestWrapper)
            {
                ServletRequestWrapper wrapper =
                    (ServletRequestWrapper)request;
                request=wrapper.getRequest();
            }
            else
                throw new IllegalArgumentException("Does not wrap ServletHttpRequest");
        }
View Full Code Here

    ServletRequest req = getRequest();
    while (req != null) {
      if (req instanceof CauchoRequest)
  return ((CauchoRequest) req).getRequestDepth(depth + 1);
      else if (req instanceof ServletRequestWrapper) {
  ServletRequestWrapper reqWrap = (ServletRequestWrapper) req;

  req = reqWrap.getRequest();
      }
      else
  break;
    }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletRequestWrapper

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.