Java Code Examples for org.springframework.mock.web.MockHttpServletResponse#getForwardedUrl()
The following examples show how to use
org.springframework.mock.web.MockHttpServletResponse#getForwardedUrl() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MockMvcWebConnection.java From spring-analysis-note with MIT License | 6 votes |
public WebResponse getResponse(WebRequest webRequest) throws IOException { long startTime = System.currentTimeMillis(); HtmlUnitRequestBuilder requestBuilder = new HtmlUnitRequestBuilder(this.sessions, this.webClient, webRequest); requestBuilder.setContextPath(this.contextPath); MockHttpServletResponse httpServletResponse = getResponse(requestBuilder); String forwardedUrl = httpServletResponse.getForwardedUrl(); while (forwardedUrl != null) { requestBuilder.setForwardPostProcessor(new ForwardRequestPostProcessor(forwardedUrl)); httpServletResponse = getResponse(requestBuilder); forwardedUrl = httpServletResponse.getForwardedUrl(); } storeCookies(webRequest, httpServletResponse.getCookies()); return new MockWebResponseBuilder(startTime, webRequest, httpServletResponse).build(); }
Example 2
Source File: MockMvcWebConnection.java From java-technology-stack with MIT License | 6 votes |
public WebResponse getResponse(WebRequest webRequest) throws IOException { long startTime = System.currentTimeMillis(); HtmlUnitRequestBuilder requestBuilder = new HtmlUnitRequestBuilder(this.sessions, this.webClient, webRequest); requestBuilder.setContextPath(this.contextPath); MockHttpServletResponse httpServletResponse = getResponse(requestBuilder); String forwardedUrl = httpServletResponse.getForwardedUrl(); while (forwardedUrl != null) { requestBuilder.setForwardPostProcessor(new ForwardRequestPostProcessor(forwardedUrl)); httpServletResponse = getResponse(requestBuilder); forwardedUrl = httpServletResponse.getForwardedUrl(); } storeCookies(webRequest, httpServletResponse.getCookies()); return new MockWebResponseBuilder(startTime, webRequest, httpServletResponse).build(); }
Example 3
Source File: MockMvcWebConnection.java From spring4-understanding with Apache License 2.0 | 5 votes |
public WebResponse getResponse(WebRequest webRequest) throws IOException { long startTime = System.currentTimeMillis(); HtmlUnitRequestBuilder requestBuilder = new HtmlUnitRequestBuilder(this.sessions, this.webClient, webRequest); requestBuilder.setContextPath(this.contextPath); MockHttpServletResponse httpServletResponse = getResponse(requestBuilder); String forwardedUrl = httpServletResponse.getForwardedUrl(); while (forwardedUrl != null) { requestBuilder.setForwardPostProcessor(new ForwardRequestPostProcessor(forwardedUrl)); httpServletResponse = getResponse(requestBuilder); forwardedUrl = httpServletResponse.getForwardedUrl(); } return new MockWebResponseBuilder(startTime, webRequest, httpServletResponse).build(); }