erdal.karaca
erdal.karaca

Reputation: 713

Add annotation to programmatically added child resource via resource builder

I am programmatically adding child resources via the resource builder and need the resulting resource method to have the PermitAll annotation present. Is this possible using some jersey API?

Upvotes: 1

Views: 143

Answers (1)

erdal.karaca
erdal.karaca

Reputation: 713

So, with my request filter checking for PermitAll annotation on the resource method, I relaized I can annotate the Inflector.apply() method directly to make the request filter work without modifying it.

resourceBuilder.handledBy(new Inflector<ContainerRequestContext, String>() {

                            @Override
                            **@PermitAll**
                            public String apply(ContainerRequestContext data) {
                                // ...
                            }
                        }

Upvotes: 1

Related Questions