Code Monkey home page Code Monkey logo

Comments (2)

johnmcclean avatar johnmcclean commented on May 18, 2024

Hi Marco,

Looking at the example, I think you'd want to follow the 'Java built in
server' way. That is register the properties
"com.sun.jersey.spi.container.ContainerRequestFilters",

"com.sun.jersey.api.container.filter.LoggingFilter;com.myprogram.AuthFilter"

Not sure how simple that is. Two options are too set the DefaultResources
or DefaultJaxRsPackages via ConfigurableModule. Both result in
ResourceConfiguration.register being called rather than property.

Alternatively you could simply add
@Getterprivate static volatile ConcurrentMap<String, List>
propertiesMap = Maps.newConcurrentMap();
To the JerseyRestApplication class and use it to set Properties on the
ResourceConfiguration.

https://github.com/aol/micro-server/blob/master/micro-core/src/main/java/com/aol/micro/server/rest/jersey/JerseyRestApplication.java

In that case, just add the Properties to Module / ConfigurableModule in the
usual way and make sure they get copied across in the
JerseySpringIntegrationContextListener. (It's basically following the exact
same pattern as per Packages or Resources).

https://github.com/aol/micro-server/blob/master/micro-core/src/main/java/com/aol/micro/server/rest/jersey/JerseySpringIntegrationContextListener.java

On Mon, Jul 27, 2015 at 2:26 PM, Marco Castigliego <[email protected]

wrote:

Hey guys,

I'd like to add a ContainerRequestFilter to implement some authorization
code (similar to this
https://simplapi.wordpress.com/2013/01/24/jersey-jax-rs-implements-a-http-basic-auth-decoder/
).

Do you know how can I do this using microservice?

Thanks :)


Reply to this email directly or view it on GitHub
#31.

from micro-server.

marcocast avatar marcocast commented on May 18, 2024

Cool, thanks John.

I think I achieved what I wanted simply creating a spring component that implements javax.servlet.Filter and com.aol.micro.server.auto.discovery.FilterConfiguration.

:) Thanks for the help!

Marco

from micro-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.