Skip to content

Instantly share code, notes, and snippets.

View ghemulyanto's full-sized avatar
💭
Learning everyday

Tri Mulyanto ghemulyanto

💭
Learning everyday
  • Alfagift
  • Tangerang Selatan
View GitHub Profile
@c0rp-aubakirov
c0rp-aubakirov / ClientInfo.java
Last active March 29, 2024 06:50
How to get full client info using servlet request, including client IP, browser, os, use-agent and referer
public void printClientInfo(HttpServletRequest request) {
final String referer = getReferer(request);
final String fullURL = getFullURL(request);
final String clientIpAddr = getClientIpAddr(request);
final String clientOS = getClientOS(request);
final String clientBrowser = getClientBrowser(request);
final String userAgent = getUserAgent(request);
logger.info("\n" +