Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequestWrapper


     * </p>
     * @return true if the request wrapper stack (size) changed.
     */
    protected boolean isRequestWrapperStackChanged()
    {
        HttpServletRequestWrapper currentRequest = this;
        int currentRequestWrapperStackSize = 0;
        while ((currentRequest.getRequest()) instanceof HttpServletRequestWrapper)
        {
            currentRequestWrapperStackSize++;
            currentRequest = (HttpServletRequestWrapper)currentRequest.getRequest();
        }
        if (currentRequestWrapperStackSize != requestWrapperStackSize)
        {
            requestWrapperStackSize = currentRequestWrapperStackSize;
            return true;
View Full Code Here


    private static String getGateInHTTPRequestParameter(PortletRequest request,
            String name) {
        String value = null;
        try {
            Method getRealReq = request.getClass().getMethod("getRealRequest");
            HttpServletRequestWrapper origRequest = (HttpServletRequestWrapper) getRealReq
                    .invoke(request);
            value = origRequest.getParameter(name);
        } catch (Exception e) {
            // do nothing - not on GateIn simple-portal
        }
        return value;
    }
View Full Code Here

    private static String getGateInHTTPHeader(PortletRequest request,
            String name) {
        String value = null;
        try {
            Method getRealReq = request.getClass().getMethod("getRealRequest");
            HttpServletRequestWrapper origRequest = (HttpServletRequestWrapper) getRealReq
                    .invoke(request);
            value = origRequest.getHeader(name);
        } catch (Exception e) {
            // do nothing - not on GateIn simple-portal
        }
        return value;
    }
View Full Code Here

            if (value == null) {
                // for GateIn portlet container simple-portal
                try {
                    Method getRealReq = request.getClass().getMethod(
                            "getRealRequest");
                    HttpServletRequestWrapper origRequest = (HttpServletRequestWrapper) getRealReq
                            .invoke(request);
                    value = origRequest.getParameter(name);
                } catch (Exception e) {
                    // do nothing - not on GateIn simple-portal
                }
            }
            return value;
View Full Code Here

            JCRNodeWrapper node = currentUserSession.getNode(path);

            Resource r = new Resource(node, "html", template, configuration);
            request.setAttribute("mode", "edit");

            request = new HttpServletRequestWrapper(request) {
                @Override
                public String getParameter(String name) {
                    if (contextParams != null && contextParams.containsKey(name)) {
                        return contextParams.get(name).get(0);
                    }
View Full Code Here

    // Create fake spec wrapper for the html:
    // (Note that the content can be big so don't use the limited String.Format)
    final String spec = createFakeSpec(content);
   
    // wrap the request with the added params
    HttpServletRequestWrapper reqWrapper = new HttpServletRequestWrapper(req) {
      @Override
      public String getParameter(String name) {
        // Mark this as an accelerate page spec
        // (The code that check for that field have to use the defined constant,
        //  hence the use of == )
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

     * </p>
     * @return true if the request wrapper stack (size) changed.
     */
    protected boolean isRequestWrapperStackChanged()
    {
        HttpServletRequestWrapper currentRequest = this;
        int currentRequestWrapperStackSize = 0;
        while ((currentRequest.getRequest()) instanceof HttpServletRequestWrapper)
        {
            currentRequestWrapperStackSize++;
            currentRequest = (HttpServletRequestWrapper)currentRequest.getRequest();
        }
        if (currentRequestWrapperStackSize != requestWrapperStackSize)
        {
            requestWrapperStackSize = currentRequestWrapperStackSize;
            return true;
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

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
        FilterChain filterChain) throws IOException, ServletException {
      final String userName = request.getParameter("user.name");
      ServletRequest requestModified =
        new HttpServletRequestWrapper((HttpServletRequest) request) {
        @Override
        public String getRemoteUser() {
          return userName;
        }
      };
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.