Commit Graph

27 Commits

Author SHA1 Message Date
Andy Wilkinson a9b88d6955 Document need for ServerEndpointExporter and show its use in a sample
Traditionally, a @ServerEndpoint-annotated bean is found by a servlet
container initialiser, however Boot does not run servlet container
initialisers when an embedded container is being used. To be able to use
@ServerEndpoint in a Boot app that uses embedded Tomcat a
ServerEndpointExporter bean must be declared.

This commit updates the documentation to describe this requirement and
also updates the WebSockets sample to illustrate the use of
ServerEndpointExporter. The version of Spring Framework has been updated
to 4.0.8.BUILD-SNAPSHOT. This picks up the fix for SPR-12340.

Closes gh-1722
2014-11-10 11:27:56 +00:00
Andy Wilkinson 186b3a66e3 Update WebSocket sample with new SockJS CDN
Closes gh-1740
2014-10-21 16:07:15 +01:00
Phillip Webb fad5ce45db Polish 2014-04-23 12:35:33 +01:00
Dave Syer 7b07fe8ce0 Convert remaining samples to use random port
Partial fix for gh-337. See also gh-607 which complements this, but might
conflict on a merge.
2014-04-17 20:29:04 -07:00
Phillip Webb 80ac1fb0cd Polish 2014-03-15 13:02:01 -07:00
Dave Syer 14d52b6c18 Avoid creating a new EmbeddedServletContainerFactory for websockets
User can now also switch off and customize the websockets customizer by adding
a bean named "websocketContainerCustomizer".

Fixes gh-479
2014-03-12 09:21:07 +00:00
Dave Syer 7a285cf65d Convert all sample tests to @IntegrationTest where appropriate
Makes them a lot more readable IMO, and also enables @Autowiring
from the context into the test case (sweeet). I added @DirtiesContext
to all of them as well to be on the safe side, but possbly that can be
optimized in some way as well.
2014-03-11 13:54:30 +00:00
Dave Syer 3bc37ddde0 Strip out most of websocket autoconfig
... leaving only the embedded Tomcat enabling feature (registering
the WsSci).

Fixes part of gh-65
2014-03-04 16:25:10 +00:00
Phillip Webb 4a58171b5c A few more package tweaks
Improve package structure and include package-info javadoc.
2014-02-12 13:50:37 -08:00
Phillip Webb 43e54d38f7 Make fields private where possible 2014-01-21 16:29:07 -08:00
Phillip Webb 0160760568 Apply latest eclipse cleanup rules 2014-01-21 16:28:26 -08:00
Phillip Webb 0029e8200c Fix copyright dates 2014-01-02 10:55:04 -08:00
Dave Syer f448e79f29 Remove long package names from samples
Long package names are really unnecessary in samples and they
just clutter things up. Also Spring Loaded doesn't work with
org.sfw packages, so to demo that technology you need a
different package name.
2013-12-31 08:40:26 +00:00
Phillip Webb f7f53e4e64 Fix for upstream Spring 4.0 changes 2013-12-03 11:51:51 -08:00
Phillip Webb 64f32893bb Source format and clean-up 2013-11-16 00:08:18 -08:00
Phillip Webb 883fd9162f Polish 2013-11-16 00:08:17 -08:00
Dave Syer 811bd32ce2 More sensible signature for servlet initializer 2013-11-07 14:03:58 +00:00
Phillip Webb 1a9ce42da9 Apply source formatting to samples 2013-10-08 20:25:10 -07:00
Ulrich von Poblotzki f306eda703 Implemented the error handling in case of commucation failures 2013-10-08 17:38:43 -04:00
Ulrich von Poblotzki 386bb73169 Added simple error hangling to 'SnakeTimer#broadcast'
In some cases the websocket communication fails and Snake#sendMessage throws an exception.
In that case the send loop is interrupted and later clients are not update.
2013-10-08 17:38:42 -04:00
Dave Syer 4655eb3a94 Expose SpringApplicationBuilder in SpringBootServletInitializer 2013-10-08 11:04:45 -04:00
Phillip Webb e16a0278ae Support single config from ServletInitializer
Update SpringBootServletInitializer with separate getConfigClass() and
getAdditionalConfigClasses() methods. This change makes it easier to
use the SpringBootServletInitializer with the common use case of a
single config class.
2013-09-25 20:58:27 -07:00
Dave Syer 5755b07e6c Switch roles of snake and echo
Snake is stateful so it should be one per connection. Echo is the
opposite.
2013-09-05 17:15:14 -07:00
Dave Syer 43fc107437 Fix security config
The management endpoints were still all mixed up
with the user endpoints. Fixed that and extracted
user endpoints in to conditional block so not
protected if path explicitly set to empty string.

[#53029715]
2013-09-05 17:14:11 -07:00
Dave Syer 767aa43e31 Add WebSocketAutoConfiguration
Opinionated defaults for WebSockets:

* If spring-websocket is on the classpath and so is
the Tomcat WSci initializer then it is added to the context
* A DefaultSockJsService is added if none is present
* User has only to define @Beans of type WebSocketHandler with
name starting "/"
* Each one is converted to a SockJsHttpRequestHandler and
mapped to "/<beanName>/**"
2013-09-05 17:14:10 -07:00
Dave Syer 6e8cbbde3b Use reflection hack for error page in Tocmat 8 2013-09-05 17:14:10 -07:00
Dave Syer c2c8144117 Add websocket sample 2013-08-05 21:40:33 +01:00