Giter Site home page Giter Site logo

Comments (5)

heowc avatar heowc commented on August 22, 2024 1

I made a simple sample using this.

See https://github.com/heowc-scratch/spring-uap_java

from uap-java.

bpossolo avatar bpossolo commented on August 22, 2024

What kind of Spring integration are you thinking?

from uap-java.

bpossolo avatar bpossolo commented on August 22, 2024

I see. So you added method argument resolvers. That’s clever however I wouldn’t recommend doing this because the user agent string will be parsed/evaluated for every single argument that is resolved.

this will impact the performance of your web app because parsing/evaluating the user agent string is expensive (it is compared against every regexp in the yaml file).

I’d recommend having a web filter which parses the user agent string once then adds the result (the Client object) to the RequestContext.

this ensures it is only evaluated once per inbound web request.

With regards to adding support for such a thing to this project... I would prefer not to add dependencies on Spring since many applications don’t use Spring (for example one of my main projects uses PlayFramework instead of Spring MVC).

I could see a side project specifically for spring+uapjava being useful though. Unfortunately I don’t really have enough time to maintain it and Spring publishes new versions pretty frequently so it would be difficult to keep current.

from uap-java.

bpossolo avatar bpossolo commented on August 22, 2024

Maybe an intermediary solution would be to have a wiki page with integration instructions for the different web frameworks like SpringMVC, PlayFramework, etc.

that could be instructional without being too prescriptive about implementation

from uap-java.

heowc avatar heowc commented on August 22, 2024

That’s clever however I wouldn’t recommend doing this because the user agent string will be parsed/evaluated for every single argument that is resolved.

I agree. Since this is a simple sample, you can try to improve it.

I would prefer not to add dependencies on Spring since many applications don’t use Spring

Oh... it's a new fact. Most of us use the spring framework 🤣

I could see a side project specifically for spring+uapjava being useful though. Unfortunately I don’t really have enough time to maintain it and Spring publishes new versions pretty frequently so it would be difficult to keep current.

I see... That's very unfortunate news. 😂

Maybe an intermediary solution would be to have a wiki page with integration instructions for the different web frameworks like SpringMVC, PlayFramework, etc.

I think this is a useful solution. 👍👍

Thanks for the many comments. 👍

from uap-java.

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.