Allow Validator config in XML websocket namespace

This commit adds a new "validator" XML attribute to the
`<websocket:message-broker/>` element. This allows configuring a
specific Validator to be used for payload validation.

Issue: SPR-13996
This commit is contained in:
Brian Clozel
2016-03-10 16:35:20 +01:00
parent 8e24a4153c
commit 8ca6a18dae
5 changed files with 61 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket.xsd">
<websocket:message-broker application-destination-prefix="/app" user-destination-prefix="/personal">
<websocket:message-broker application-destination-prefix="/app" user-destination-prefix="/personal" validator="myValidator">
<websocket:stomp-endpoint path="/foo,/bar">
<websocket:handshake-handler ref="myHandler"/>
</websocket:stomp-endpoint>
@@ -31,4 +31,6 @@
<bean id="myInterceptor" class="org.springframework.web.socket.config.TestChannelInterceptor"/>
<bean id="myValidator" class="org.springframework.web.socket.config.TestValidator"/>
</beans>