Append suffx to user dest in SimpMessagingTemplate

Isssue: SPR-11868
This commit is contained in:
Rossen Stoyanchev
2014-06-27 12:34:51 -04:00
parent 682a910bb6
commit 7a5b3c1eed
3 changed files with 23 additions and 3 deletions

View File

@@ -77,8 +77,9 @@ public class SimpMessagingTemplate extends AbstractMessageSendingTemplate<String
* @see org.springframework.messaging.simp.user.UserDestinationMessageHandler
*/
public void setUserDestinationPrefix(String prefix) {
Assert.notNull(prefix, "UserDestinationPrefix must not be null");
this.userDestinationPrefix = prefix;
Assert.hasText(prefix, "'userDestinationPrefix' must not be empty");
this.userDestinationPrefix = prefix.endsWith("/") ? prefix : prefix + "/";
}
/**