반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- popup
- nodejs
- NextJS
- centos7
- Next.js
- node.js
- git
- mybatis
- MSsql
- Tomcat
- jquery
- ajax
- javascript
- pwa
- jenkins
- Eclipse
- Maven
- PM2
- Push
- MariaDB
- rocky9
- yona
- SpringBoot
- security
- FCM
- docker
- Java
- spring3
- config
- mysql
Archives
- Today
- Total
ふたりで
browser type check by JAVA 본문
728x90
반응형
SMALL
request객체에 담겨오는 브라우저 타입을 체크하여 특정 브라우저가 아닐 경우 지정된 페이지로 redriect
할 때 사용했다.
//IE-browser type check: Chrome, Chromium, Firefox 가 아닐 경우 크롬설치 안내 페이지로 redirect
String userAgent = request.getHeader("User-Agent");
if(userAgent.indexOf("Trident") > -1
|| userAgent.indexOf("msie") > -1
|| userAgent.indexOf("Netscape") > -1
|| (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1)
|| (userAgent.indexOf("Opera") > -1 || userAgent.indexOf("OPR") > -1)
) {
return "redirect:/chromeInfo";
}
728x90
반응형
LIST
'Spring' 카테고리의 다른 글
mybatis+select count() resultType (0) | 2023.11.27 |
---|---|
JsonData를 VO model로 바로 받을때...참고 (0) | 2023.07.07 |
Springboot2.x Web 프로젝트 설정 1(프로젝트 생성 및 JSP설정) (0) | 2023.05.08 |
springboot+security session timeout config (0) | 2022.06.23 |
spring tags + application.properties 값 참조 하기 (0) | 2022.04.28 |
Comments