Skip to content

HttpServletRequest Attributes not available to jooby App #674

@andrenpaes

Description

@andrenpaes

We're trying to use jooby inside a Servlet container. In that setup, we also have a Filter that adds request scoped info into each request (using HttpServletRequest#setAttribute).

Unfortunately, there's no way to access those attributes using jooby's Request object. We have an ugly workaround in place, using a ThreadLocal and a jooby before filter:

before((req, rsp) -> {
    req.set("attributeName", someThreadLocal.get());
});

A possible solution, would be merging the HttpServletRequest#attributes into jooby's locals attributes. I have a patch that implements that, I can open a PR if it seems like a good enough solution. Let me know.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions