當前位置: 首頁>>代碼示例>>Java>>正文


Java UriUtils.encodePathSegment方法代碼示例

本文整理匯總了Java中org.springframework.web.util.UriUtils.encodePathSegment方法的典型用法代碼示例。如果您正苦於以下問題:Java UriUtils.encodePathSegment方法的具體用法?Java UriUtils.encodePathSegment怎麽用?Java UriUtils.encodePathSegment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.web.util.UriUtils的用法示例。


在下文中一共展示了UriUtils.encodePathSegment方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
	log.info("encodeUrlPathSegment()");
	try{
		String enc = httpServletRequest.getCharacterEncoding();
		if (enc == null) {
			enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
		}
		try {
			pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
		} catch (UnsupportedEncodingException uee) {log.error(uee);}
		return pathSegment;
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		throw (new RuntimeException(e));
	}
}
 
開發者ID:JD-Software,項目名稱:JDeSurvey,代碼行數:17,代碼來源:LoginController.java

示例2: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
/**
 * helper function for encoding paths 
 * @param pathSegment
 * @param httpServletRequest
 * @return
 */
String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
	log.info("encodeUrlPathSegment()");
	try{
		String enc = httpServletRequest.getCharacterEncoding();
		if (enc == null) {
			enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
		}
		try {
			pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
		} catch (UnsupportedEncodingException uee) {log.error(uee);}
		return pathSegment;
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		throw (new RuntimeException(e));
	}
}
 
開發者ID:JD-Software,項目名稱:JDeSurvey,代碼行數:23,代碼來源:AccountController.java

示例3: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
/**
 * Helper method that encodes a string
 * @param pathSegment
 * @param httpServletRequest
 * @return
 */
String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
	log.info("encodeUrlPathSegment()");
	try{
		String enc = httpServletRequest.getCharacterEncoding();
		if (enc == null) {
			enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
		}
		try {
			pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
		} catch (UnsupportedEncodingException uee) {log.error(uee);}
		return pathSegment;
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		throw (new RuntimeException(e));
	}
}
 
開發者ID:JD-Software,項目名稱:JDeSurvey,代碼行數:23,代碼來源:UserController.java

示例4: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
/**
 * Encodes a string path suing the  httpServletRequest Character Encoding
 * @param pathSegment
 * @param httpServletRequest
 * @return
 */
String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
	log.info("encodeUrlPathSegment()");
	try{
		String enc = httpServletRequest.getCharacterEncoding();
		if (enc == null) {
			enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
		}
		try {
			pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
		} catch (UnsupportedEncodingException uee) {log.error(uee);}
		return pathSegment;
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		throw (new RuntimeException(e));
	}
}
 
開發者ID:JD-Software,項目名稱:JDeSurvey,代碼行數:23,代碼來源:SurveyDefinitionController.java

示例5: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
       String enc = httpServletRequest.getCharacterEncoding();
       if (enc == null) {
           enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
       }
       try {
           pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
} catch (UnsupportedEncodingException uee) {}
       return pathSegment;
   }
 
開發者ID:EsupPortail,項目名稱:esup-nfc-tag-server,代碼行數:11,代碼來源:NfcIndexController.java

示例6: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
String encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
    String enc = httpServletRequest.getCharacterEncoding();
    if (enc == null) {
        enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
    }
    try {
        pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
    } catch (UnsupportedEncodingException uee) {}
    return pathSegment;
}
 
開發者ID:RBGKew,項目名稱:Reconciliation-and-Matching-Framework,代碼行數:11,代碼來源:CustomReporterController.java

示例7: encodePathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
private String encodePathSegment(final String pathSegment) {
  try {
    return UriUtils.encodePathSegment(pathSegment, "UTF-8");
  } catch (UnsupportedEncodingException e) {
    // the best we can do without messing up all caller signatures :/ MK.
    return pathSegment;
  }
}
 
開發者ID:rabbitmq,項目名稱:hop,代碼行數:9,代碼來源:Client.java

示例8: encodePathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
private static String encodePathSegment(String pathSegment)
{
	try
	{
		return UriUtils.encodePathSegment(pathSegment, UTF_8.name());
	}
	catch (UnsupportedEncodingException e)
	{
		throw new MolgenisRuntimeException(e);
	}
}
 
開發者ID:molgenis,項目名稱:molgenis,代碼行數:12,代碼來源:Href.java

示例9: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
protected String encodeUrlPathSegment(String pathSegment, HttpServletRequest request) {
    String enc = request.getCharacterEncoding();
    if (enc == null) {
        enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
    }
    try {
        pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
    }
    catch (UnsupportedEncodingException uee) {}
    return pathSegment;
}
 
開發者ID:houdejun214,項目名稱:lakeside-java,代碼行數:12,代碼來源:BaseController.java

示例10: encodeUrlPathSegment

import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類
public static String encodeUrlPathSegment(String pathSegment, HttpServletRequest request) 
{
    String enc = request.getCharacterEncoding();
    if (enc == null) {
        enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
    }
    try {
        pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
    }
    catch (UnsupportedEncodingException uee) {}
    return pathSegment;
}
 
開發者ID:timedesk,項目名稱:timedesk,代碼行數:13,代碼來源:UrlEncoder.java


注:本文中的org.springframework.web.util.UriUtils.encodePathSegment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。