Package org.springframework.extensions.webscripts.servlet

Examples of org.springframework.extensions.webscripts.servlet.WebScriptServletRequest


    verify(handler).handleContent(eq(content));
  }

  @Test
  public void testHandleHttpServletRequest() {
    final WebScriptServletRequest nextRequest = mock(WebScriptServletRequest.class);
    when(nextRequest.getHttpServletRequest()).thenReturn(mock(HttpServletRequest.class));
    handleGet("/handleHttpServletRequest", new MockWebScriptRequest().next(nextRequest));
    verify(handler).handleHttpServletRequest(any(HttpServletRequest.class));
  }
View Full Code Here


      WebScriptRequest request, final WebScriptResponse response) {
    if (request instanceof AnnotationWebScriptRequest) {
      request = ((AnnotationWebScriptRequest) request).getWebScriptRequest();
    }
    FormField formField = null;
    final WebScriptServletRequest req = WebScriptUtil.extractWebScriptServletRequest(request);
    if (req != null) {
      String parameterName = fileField.value();
      if (StringUtils.hasText(parameterName) == false) {
        parameterName = name;
      }
      formField = req.getFileField(parameterName);
    }
    return formField;
  }
View Full Code Here

  @Autowired
  private FileFieldHandler handler;

  @Test
  public void testHandleFileField() {
    final WebScriptServletRequest nextRequest = mock(WebScriptServletRequest.class);
    when(nextRequest.getFileField(anyString())).thenReturn(mock(FormField.class));
    handleGet("/handleFileField", new MockWebScriptRequest().next(nextRequest));
    verify(handler).handleFileField(any(FormField.class));
  }
View Full Code Here

*
*/
public class WebScriptUtil {

  public static WebScriptServletRequest extractWebScriptServletRequest(final WebScriptRequest request) {
    WebScriptServletRequest webScriptServletRequest = null;
    if (request instanceof WrappingWebScriptRequest) {
      final WebScriptRequest nextRequest = ((WrappingWebScriptRequest) request).getNext();
      if (nextRequest instanceof WebScriptServletRequest) {
        webScriptServletRequest = ((WebScriptServletRequest) nextRequest);
      } else if (nextRequest != null) {
View Full Code Here

TOP

Related Classes of org.springframework.extensions.webscripts.servlet.WebScriptServletRequest

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.