![JAR search and dependency download from the Maven repository](/logo.png)
com.mergeplus.utils.WebUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of merge-plus Show documentation
Show all versions of merge-plus Show documentation
merge-plus is a plus to merge dictionary value
The newest version!
package com.mergeplus.utils;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* WebUtils工具类
*/
public class WebUtils {
/**
* 获取HttpServletRequest对象
*
* @return request
*/
public static HttpServletRequest getRequest() {
HttpServletRequest request = null;
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (requestAttributes != null) {
request = ((ServletRequestAttributes) requestAttributes).getRequest();
}
return request;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy