Comments (5)
I made a simple sample using this.
See https://github.com/heowc-scratch/spring-uap_java
from uap-java.
What kind of Spring integration are you thinking?
from uap-java.
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.
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.
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)
- Building jar doesn't work HOT 1
- maven release HOT 1
- Hi, Benjamin HOT 1
- Why not deploy to maven central? HOT 1
- Please release to include latest changes to UAP-Core HOT 5
- IOException not imported by CacheParser HOT 5
- Update uap-core to 0.13.0 HOT 1
- SnakeYAML requires the java.desktop module HOT 1
- parse error HOT 2
- UserAgent Parser does not support patchMinor
- CVE-2022-25857 snakeyaml: Denial of Service due to missing nested depth limitation for collections HOT 2
- Migrate yaml parsing to compile phase HOT 2
- Make it possible to use RE2J instead of java.util.regexp HOT 5
- Change yaml parser to org.snakeyaml:snakeyaml-engine HOT 8
- CVE-2022-1471 - Dependency Snakeyaml Critical 9.8 score vulnerability HOT 10
- User-agent with CriOS mapped wrongly
- User-agent with EdgiOS mapped wrongly
- Bring back Java 8 Support HOT 4
- UserAgent Parser does not support brand and model in device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uap-java.