Examples of MissingServletRequestPartException


Examples of org.springframework.web.multipart.support.MissingServletRequestPartException

    RequestPart annot = parameter.getParameterAnnotation(RequestPart.class);
    boolean isRequired = (annot == null || annot.required());

    if (arg == null && isRequired) {
      throw new MissingServletRequestPartException(partName);
    }
   
    return arg;
  }
View Full Code Here

Examples of org.springframework.web.multipart.support.MissingServletRequestPartException

    RequestPart annot = parameter.getParameterAnnotation(RequestPart.class);
    boolean isRequired = (annot == null || annot.required());

    if (arg == null && isRequired) {
      throw new MissingServletRequestPartException(partName);
    }

    return arg;
  }
View Full Code Here

Examples of org.springframework.web.multipart.support.MissingServletRequestPartException

    RequestPart annot = parameter.getParameterAnnotation(RequestPart.class);
    boolean isRequired = (annot == null || annot.required());

    if (arg == null && isRequired) {
      throw new MissingServletRequestPartException(partName);
    }

    return arg;
  }
View Full Code Here

Examples of org.springframework.web.multipart.support.MissingServletRequestPartException

    testException(ex);
  }

  @Test
  public void missingServletRequestPart() {
    Exception ex = new MissingServletRequestPartException("partName");
    testException(ex);
  }
View Full Code Here

Examples of org.springframework.web.multipart.support.MissingServletRequestPartException

    assertEquals("Invalid status code", 400, response.getStatus());
  }

  @Test
  public void handleMissingServletRequestPartException() throws Exception {
    MissingServletRequestPartException ex = new MissingServletRequestPartException("name");
    ModelAndView mav = exceptionResolver.resolveException(request, response, null, ex);
    assertNotNull("No ModelAndView returned", mav);
    assertTrue("No Empty ModelAndView returned", mav.isEmpty());
    assertEquals("Invalid status code", 400, response.getStatus());
    assertEquals("Required request part 'name' is not present.", response.getErrorMessage());
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.