| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
addController(java.lang.String path, java.lang.Class<? extends Controller> controllerClass)Register a controller |
|
public FilterRegistration |
addFilter(RequestFilter filter)Add a diego.web.Router.RequestFilter |
|
public FilterRegistration |
addFilter(java.lang.String pathTemplate, RequestFilter filter)Add a diego.web.Router.RequestFilter |
|
public FilterRegistration |
addFilter(java.lang.Class<? extends RequestFilter> filter)Add a diego.web.Router.RequestFilter |
|
public Registration |
addInterceptor(Interceptor interceptor)Register an interceptor. |
|
public Registration |
addInterceptor(java.lang.String urlPattern, Interceptor interceptor)Register an interceptor for a given URI pattern e.g. |
|
public Registration |
addInterceptor(java.lang.Class<? extends Interceptor> interceptorClass)Register an interceptor using its class name. |
|
public void |
addWebSocketEndpoint(java.lang.String path, java.lang.Class<?> webSocketClass) |
|
public StaticResourceHandler |
serve(java.lang.String pathSpec, java.nio.file.Path dir)Serve files from a local directory |
Register a controller
path - The controller path e.g. /photoscontrollerClass - A class containing controller actionsAdd a diego.web.Router.RequestFilter
filter - The filter to add. It will default to filtering all requests. By default, it will filter all requests. Use diego.web.Router.FilterRegistration#setUrlPattern(String) to change this.Add a diego.web.Router.RequestFilter
pathTemplate - The URI pattern to interceptfilter - A class that implements the diego.web.Router.RequestFilter interface.Add a diego.web.Router.RequestFilter
filter - A class that implements the diego.web.Router.RequestFilter interface. By default, it will filter all requests. Use diego.web.Router.FilterRegistration#setUrlPattern(String) to change this.Register an interceptor. If you wish to only apply it to certain URI's, be sure to call Registration#addUrlPattern(String)#addUrlPattern(String).
interceptor - A request interceptor Register an interceptor for a given URI pattern e.g. /secure/*
urlPattern - The URI patterninterceptor - The interceptorRegister an interceptor using its class name. The interceptor will be created using the dependency injection tooling.
interceptorClass - A class representing an Interceptor
Set up a WebSocket endpoint. See WebSocket Endpoints
This endpoint will be accessible from /@ws/{pathsSpec}
path - The path to the endpoint e.g. "/chat"webSocketClass - A class that extends the jakarta.websocket.Endpoint class.Serve files from a local directory
pathSpec - The servlet mapping path. For example "assets/*"dir - The directory on disk