本文整理匯總了Java中org.springframework.web.util.UrlPathHelper.getOriginatingQueryString方法的典型用法代碼示例。如果您正苦於以下問題:Java UrlPathHelper.getOriginatingQueryString方法的具體用法?Java UrlPathHelper.getOriginatingQueryString怎麽用?Java UrlPathHelper.getOriginatingQueryString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.util.UrlPathHelper
的用法示例。
在下文中一共展示了UrlPathHelper.getOriginatingQueryString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLocation
import org.springframework.web.util.UrlPathHelper; //導入方法依賴的package包/類
/**
* 獲得當的訪問路徑
*
* HttpServletRequest.getRequestURL+"?"+HttpServletRequest.getQueryString
*
* @param request
* @return
*/
public static String getLocation(HttpServletRequest request) {
UrlPathHelper helper = new UrlPathHelper();
StringBuffer buff = request.getRequestURL();
String uri = request.getRequestURI();
String origUri = helper.getOriginatingRequestUri(request);
buff.replace(buff.length() - uri.length(), buff.length(), origUri);
String queryString = helper.getOriginatingQueryString(request);
if (queryString != null) {
buff.append("?").append(queryString);
}
return buff.toString();
}
示例2: getPageInfo
import org.springframework.web.util.UrlPathHelper; //導入方法依賴的package包/類
/**
* 獲得翻頁信息
*
* @param request
* @return
*/
public static PageInfo getPageInfo(HttpServletRequest request) {
UrlPathHelper helper = new UrlPathHelper();
String uri = helper.getOriginatingRequestUri(request);
String queryString = helper.getOriginatingQueryString(request);
return getPageInfo(uri, queryString);
}