eclipse-ee4j / eclipse-ee4j/jersey

Jersey/JAX-RS WriterInterceptor and HTTP Status

Open
#4,746 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

I have a a question, I am writing a `WriterInterceptor` which should save the answer entity to the database, the problem is that I cannot retrieve the HTTP status inside the Interceptor, to avoid saving the answer in case of an error, I tried `@Context
HttpServletResponse` but the status is 200 when it becomes 500 shortly after (in the class `org.glassfish.jersey.servlet.ServletContainer`), how can I inject '`Response`'? Or `ContainerResponse`/`ContainerResponseContext`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.