Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class ExceptionTranslationFilter
- Object
- ExceptionTranslationFilter
ImplementsSecurityFilter
Turns the security exceptions thrown by what follows it – the authorization rules, a controller, a service the controller calls – into answers.
- An
AuthenticationExceptiongoes to theAuthenticationEntryPoint: a 401 with a challenge, or a redirect to the login page. - An
AccessDeniedExceptionfor an anonymous caller goes there too, after the address is remembered, because the remedy is to sign in. - An
AccessDeniedExceptionfor a signed-in caller goes to theAccessDeniedHandler: 403.
Anything else is not this filter’s and is thrown on.
Methods
public HttpServer.Response doFilter(HttpServer.Request request, FilterChain chain)
throws Exception | The answer to request; null when nothing under the chain routes it, which the server answers 404. |
Inherited methods
Method details
doFilter
public HttpServer.Response doFilter(HttpServer.Request request, FilterChain chain)
throws ExceptionThe answer to
request; null when nothing under the chain routes it,
which the server answers 404.