Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This is a library that can be used to parse the User Agent header in a Spring Boot 3 application.

NotificationsYou must be signed in to change notification settings

k143408/user-agent-parser-spring-boot-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a library that can be used to parse the User Agent header in a Spring Boot 3 application.

Import Dependency:

Maven

<dependency>  <groupId>org.useragent.parse</groupId>  <artifactId>resolver-spring-boot-3</artifactId>  <version>1.0.0</version></dependency>

Gradle (Kotlin)

implementation("org.useragent.parse:resolver-spring-boot-3:1.0.0")

To build the project, execute

mvn package

Configuration:

importorg.springframework.web.servlet.config.annotation.WebMvcConfigurer;importorg.useragent.parse.DeviceResolverHandlerInterceptor;classResolverHandlerInterceptorimplementsWebMvcConfigurer {@OverridepublicvoidaddInterceptors(InterceptorRegistryregistry) {registry        .addInterceptor(newDeviceResolverHandlerInterceptor()).addPathPatterns(ALL);  }}

Usage:

importorg.useragent.parse.Device;importorg.useragent.parse.DevicePlatform;importorg.useragent.parse.DeviceUtils;Devicedevice =DeviceUtils.getCurrentDevice(httpServletRequest);device.isMobile()// true or falsedevice.isNormal()// true or falsedevice.isTablet()// true or falseDevicePlatformplatform =device.getDevicePlatform();

About

This is a library that can be used to parse the User Agent header in a Spring Boot 3 application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp