Spring Framework ServletServerHttpResponse - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ServletServerHttpResponse class.

This code example shows how to use the following methods:getBody, getHeaders, setStatusCode
7
CodeRank
This code example shows how to use the following methods:close
	public final ModelAndView handleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) 
			throws Exception { 
		ModelAndView modelAndView = new ModelAndView(); 
		try { 
			Message<?> replyMessage = super.doHandleRequest(servletRequest, servletResponse); 
			ServletServerHttpResponse response = new ServletServerHttpResponse(servletResponse); 
			if (replyMessage != null) { 
				Object reply = setupResponseAndConvertReply(response, replyMessage); 
				response.close(); 
				modelAndView.addObject(this.replyKey, reply); 
			} 
			else { 
				setStatusCodeIfNeeded(response); 
			} 
 
			if (this.viewExpression != null) { 
				Object view; 
				if (replyMessage != null) { 
					view = this.viewExpression.getValue(this.evaluationContext, replyMessage); 
				} 
6
CodeRank
This code example shows how to use the following methods:
		this.request = new ServletServerHttpRequest(this.servletRequest); 
	} 
 
	protected void resetResponse() { 
		this.servletResponse = new MockHttpServletResponse(); 
		this.response = new ServletServerHttpResponse(this.servletResponse); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
		super.setUp(); 
 
		this.frameFormat = new DefaultSockJsFrameFormat("%s"); 
 
		this.servletResponse = new MockHttpServletResponse(); 
		this.response = new ServletServerHttpResponse(this.servletResponse); 
 
		this.servletRequest = new MockHttpServletRequest(); 
		this.servletRequest.setAsyncSupported(true); 
		this.request = new ServletServerHttpRequest(this.servletRequest); 
	} 
 
	@Test 
	public void handleInitialRequest() throws Exception { 
 
		this.session.handleInitialRequest(this.request, this.response, this.frameFormat); 
 
		assertEquals("hhh\no", this.servletResponse.getContentAsString()); 
		assertFalse(this.servletRequest.isAsyncStarted()); 
 
5
CodeRank
This code example shows how to use the following methods:
	public void setUp() { 
		ConversionService conversionService = new DefaultConversionService(); 
		this.converter = new ObjectToStringHttpMessageConverter(conversionService); 
 
		this.servletResponse = new MockHttpServletResponse(); 
		this.response = new ServletServerHttpResponse(this.servletResponse); 
	} 
 
	@Test 
	public void canRead() { 
		assertFalse(this.converter.canRead(Math.class, null)); 
		assertFalse(this.converter.canRead(Resource.class, null)); 
 
		assertTrue(this.converter.canRead(Locale.class, null)); 
		assertTrue(this.converter.canRead(BigInteger.class, null)); 
 
		assertFalse(this.converter.canRead(BigInteger.class, MediaType.TEXT_HTML)); 
		assertFalse(this.converter.canRead(BigInteger.class, MediaType.TEXT_XML)); 
		assertFalse(this.converter.canRead(BigInteger.class, MediaType.APPLICATION_XML)); 
	} 
5
CodeRank
See Code Examples for Spring Framework ServletServerHttpResponse Methods: