cn.gtmap.estateplat.utils
类 WebUtil

java.lang.Object
  继承者 org.springframework.web.util.WebUtils
      继承者 cn.gtmap.estateplat.utils.WebUtil

public class WebUtil
extends org.springframework.web.util.WebUtils


字段摘要
static String UN_KNOWN
           
static String USER_AGENT_HEADER
           
 
从类 org.springframework.web.util.WebUtils 继承的字段
CONTENT_TYPE_CHARSET_PREFIX, DEFAULT_CHARACTER_ENCODING, DEFAULT_WEB_APP_ROOT_KEY, ERROR_EXCEPTION_ATTRIBUTE, ERROR_EXCEPTION_TYPE_ATTRIBUTE, ERROR_MESSAGE_ATTRIBUTE, ERROR_REQUEST_URI_ATTRIBUTE, ERROR_SERVLET_NAME_ATTRIBUTE, ERROR_STATUS_CODE_ATTRIBUTE, FORWARD_CONTEXT_PATH_ATTRIBUTE, FORWARD_PATH_INFO_ATTRIBUTE, FORWARD_QUERY_STRING_ATTRIBUTE, FORWARD_REQUEST_URI_ATTRIBUTE, FORWARD_SERVLET_PATH_ATTRIBUTE, HTML_ESCAPE_CONTEXT_PARAM, INCLUDE_CONTEXT_PATH_ATTRIBUTE, INCLUDE_PATH_INFO_ATTRIBUTE, INCLUDE_QUERY_STRING_ATTRIBUTE, INCLUDE_REQUEST_URI_ATTRIBUTE, INCLUDE_SERVLET_PATH_ATTRIBUTE, SESSION_MUTEX_ATTRIBUTE, SUBMIT_IMAGE_SUFFIXES, TEMP_DIR_CONTEXT_ATTRIBUTE, WEB_APP_ROOT_KEY_PARAM
 
构造方法摘要
WebUtil()
           
 
方法摘要
static StringBuilder appendBuilder(StringBuilder sb, CharSequence... strs)
           
static String getIP()
          获取ip
static String getIP(javax.servlet.http.HttpServletRequest request)
          获取ip
static javax.servlet.http.HttpServletRequest getRequest()
          获取 HttpServletRequest
static byte[] getRequestBytes(javax.servlet.http.HttpServletRequest request)
          获取 request 请求的 byte[] 数组
static String getRequestParamString(javax.servlet.http.HttpServletRequest request)
          获取 request 中 json 字符串的内容
static String getRequestStr(javax.servlet.http.HttpServletRequest request)
          获取 request 请求内容
static String getRequestStr(javax.servlet.http.HttpServletRequest request, byte[] buffer)
          获取 request 请求内容
static String removeSuffix(CharSequence str, CharSequence suffix)
          去掉指定后缀
 
从类 org.springframework.web.util.WebUtils 继承的方法
clearErrorRequestAttributes, exposeErrorRequestAttributes, exposeForwardRequestAttributes, exposeRequestAttributes, extractFilenameFromUrlPath, extractFullFilenameFromUrlPath, findParameterValue, findParameterValue, getCookie, getDefaultHtmlEscape, getNativeRequest, getNativeResponse, getOrCreateSessionAttribute, getParametersStartingWith, getRealPath, getRequiredSessionAttribute, getSessionAttribute, getSessionId, getSessionMutex, getTargetPage, getTempDir, hasSubmitParameter, isDefaultHtmlEscape, isIncludeRequest, parseMatrixVariables, removeWebAppRootSystemProperty, setSessionAttribute, setWebAppRootSystemProperty
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

UN_KNOWN

public static final String UN_KNOWN
另请参见:
常量字段值

USER_AGENT_HEADER

public static final String USER_AGENT_HEADER
另请参见:
常量字段值
构造方法详细信息

WebUtil

public WebUtil()
方法详细信息

getIP

public static String getIP()
获取ip

返回:
{String}

getIP

public static String getIP(javax.servlet.http.HttpServletRequest request)
获取ip

参数:
request - HttpServletRequest
返回:
{String}

getRequest

public static javax.servlet.http.HttpServletRequest getRequest()
获取 HttpServletRequest

返回:
{HttpServletRequest}

getRequestBytes

public static byte[] getRequestBytes(javax.servlet.http.HttpServletRequest request)
                              throws IOException
获取 request 请求的 byte[] 数组

参数:
request - request
返回:
byte[]
抛出:
IOException - IOException

getRequestParamString

public static String getRequestParamString(javax.servlet.http.HttpServletRequest request)
获取 request 中 json 字符串的内容

参数:
request - request
返回:
字符串内容

getRequestStr

public static String getRequestStr(javax.servlet.http.HttpServletRequest request)
                            throws IOException
获取 request 请求内容

参数:
request - request
返回:
String
抛出:
IOException - IOException

getRequestStr

public static String getRequestStr(javax.servlet.http.HttpServletRequest request,
                                   byte[] buffer)
                            throws IOException
获取 request 请求内容

参数:
request - request
buffer - buffer
返回:
String
抛出:
IOException - IOException

appendBuilder

public static StringBuilder appendBuilder(StringBuilder sb,
                                          CharSequence... strs)

removeSuffix

public static String removeSuffix(CharSequence str,
                                  CharSequence suffix)
去掉指定后缀

参数:
str - 字符串
suffix - 后缀
返回:
切掉后的字符串,若后缀不是 suffix, 返回原字符串


Copyright © 2015–2022 cn.gtmap. All rights reserved.