CORS

Cross-Origin Resource Sharing (CORS) is supported through a Java filter and can be enabled in any SeedStack application. Seed integrates the CORS filter from dzhuvinov software. There is no need to install and configure the filter manually, it is automatically registered by Seed. All filter options can be specified through configuration properties. Configuration CORS can be enabled and configuration as below: Configuration Tool web: cors: # The servlet path mapping on which CORS will be active path: (String) # If true, Cross-Origin-Resource-Sharing (CORS) will be enabled enabled: (boolean) # Allows to specify custom properties to the CORS filter (see below) properties: key: (String) To dump the web.

REST

The seed-rest-core and its companion modules provides support for exposing REST resources using JAX-RS. SeedStack implements the JAX-RS standard through the Jersey 2 implementation.

Running Web applications

The seed-web-core and its companion modules provide support for Web technologies, such as Servlets, WebSockets, embedded Web servers, serving static resources, etc…

Servlet, filters and listeners

Servlets, filters and listeners can be detected and registered by SeedStack which makes them injectable and interceptable. Servlets You can register a servlet by annotating your servlet class with @WebServlet: @WebServlet("/my-servlet") public class MyServlet extends HttpServlet { ... } You can specify a priority on each listener to order them in the context initialization and destruction sequences: add a @Priority annotation to the listener class with the absolute priority as value.

Static resources

SeedStack provides static resource serving from the classpath and the document root with some benefits over the container default resource serving: Automatic serving of pre-minified and/or pre-gzipped versions of resources, On-the-fly gzipping of resources, Cache friendly. Behavior The behavior is to serve resources located under the document root folder and, if not found, under the META-INF/resources classpath location on the /* path. For example, consider the following folder tree:

W20 bridge

The SeedStack W20 bridge acts as an integration bridge between the Seed Java framework and the W20 Web framework.

WebSockets

Seed also integrates the Java API for WebSocket (JSR 356), allowing server and client endpoints to be injected. WebSocket support requires Java 7 and a compatible server to work. Server endpoints Server endpoints have to explicitly specify a SeedBaseEndpointConfigurator to be managed by Seed. @ServerEndpoint(value = "/chat", configurator = BaseServerEndpointConfigurator.class) public class ChatEndpoint { @Logging private Logger logger; @Inject EchoService echoService; @OnOpen public void onOpen(Session session) { logger.info("Connected ... " + session.