Package org.hdiv.filter

Examples of org.hdiv.filter.RequestWrapper


      MultipartRequestWrapper wrapper = (MultipartRequestWrapper) request;
      ServletRequest origRequest = wrapper.getRequest();
      if (origRequest != null && origRequest instanceof RequestWrapper) {

        RequestWrapper requestWrapper = (RequestWrapper) origRequest;

        Boolean maxLengthExceeded = (Boolean) request.getAttribute(ATTRIBUTE_MAX_LENGTH_EXCEEDED);
        if ((maxLengthExceeded != null) && (maxLengthExceeded.booleanValue())) {
          return;
        }

        HdivMultipartException multipartException = (HdivMultipartException) request
            .getAttribute(IMultipartConfig.FILEUPLOAD_EXCEPTION);
        if (multipartException != null) {
          Exception orig = multipartException.getOriginal();
          log.error("Failed to parse multipart request", orig);
          if (orig instanceof ServletException) {
            throw (ServletException) orig;
          } else {
            throw new ServletException("Failed to parse multipart request", orig);
          }
        }

        // file items
        Map<String, Object> items = requestWrapper.getFileElements();

        for (Object fileItem : items.values()) {
          if (items != null) {
            addFileParameter((List) fileItem);
          }
        }

        // text items
        items = requestWrapper.getTextElements();

        for (String currentTextKey : items.keySet()) {

          String[] currentTextValue = (String[]) items.get(currentTextKey);
          this.addTextParameter(wrapper, currentTextKey, currentTextValue);
View Full Code Here


    this.dataComposer.endPage();

    request.addParameter(hdivParameter, pageState);
    request.addParameter("paramName", "<script>storeCookie()</script>");

    RequestWrapper requestWrapper = new RequestWrapper(request);
    boolean result = helper.validate(requestWrapper).isValid();
    assertTrue(result);

    // Editable errors in request?
    Map<String, String[]> parameters = (Map<String, String[]>) requestWrapper
        .getAttribute(Constants.EDITABLE_PARAMETER_ERROR);
    assertEquals(1, parameters.size());

    // Set request attributes on threadlocal
    RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(requestWrapper));
View Full Code Here

TOP

Related Classes of org.hdiv.filter.RequestWrapper

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.