org.springframework.web.socket.sockjs.frame.DefaultSockJsFrameFormat Java Examples

The following examples show how to use org.springframework.web.socket.sockjs.frame.DefaultSockJsFrameFormat. 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: HtmlFileTransportHandler.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("<script>\np(\"%s\");\n</script>\r\n") {
		@Override
		protected String preProcessContent(String content) {
			return JavaScriptUtils.javaScriptEscape(content);
		}
	};
}
 
Example #2
Source File: HttpSockJsSessionTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Before
public void setup() {

	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);
}
 
Example #3
Source File: HtmlFileTransportHandler.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("<script>\np(\"%s\");\n</script>\r\n") {
		@Override
		protected String preProcessContent(String content) {
			return JavaScriptUtils.javaScriptEscape(content);
		}
	};
}
 
Example #4
Source File: HttpSockJsSessionTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Before
public void setup() {

	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);
}
 
Example #5
Source File: HtmlFileTransportHandler.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("<script>\np(\"%s\");\n</script>\r\n") {
		@Override
		protected String preProcessContent(String content) {
			return JavaScriptUtils.javaScriptEscape(content);
		}
	};
}
 
Example #6
Source File: JsonpPollingTransportHandler.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	// We already validated the parameter above...
	String callback = getCallbackParam(request);

	return new DefaultSockJsFrameFormat("/**/" + callback + "(\"%s\");\r\n") {
		@Override
		protected String preProcessContent(String content) {
			return JavaScriptUtils.javaScriptEscape(content);
		}
	};
}
 
Example #7
Source File: HttpSockJsSessionTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {

	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);
}
 
Example #8
Source File: EventSourceTransportHandler.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("data: %s\r\n\r\n");
}
 
Example #9
Source File: XhrPollingTransportHandler.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("%s\n");
}
 
Example #10
Source File: XhrStreamingTransportHandler.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("%s\n");
}
 
Example #11
Source File: EventSourceTransportHandler.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("data: %s\r\n\r\n");
}
 
Example #12
Source File: XhrPollingTransportHandler.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("%s\n");
}
 
Example #13
Source File: XhrStreamingTransportHandler.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("%s\n");
}
 
Example #14
Source File: EventSourceTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("data: %s\r\n\r\n");
}
 
Example #15
Source File: XhrPollingTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("%s\n");
}
 
Example #16
Source File: XhrStreamingTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
	return new DefaultSockJsFrameFormat("%s\n");
}