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


Java WebUtils.DEFAULT_CHARACTER_ENCODING屬性代碼示例

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


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

示例1: getDefaultEncoding

protected String getDefaultEncoding() {
	String encoding = getFileUpload().getHeaderEncoding();
	if (encoding == null) {
		encoding = WebUtils.DEFAULT_CHARACTER_ENCODING;
	}
	return encoding;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:CommonsFileUploadSupport.java

示例2: getWriter

@Override
public PrintWriter getWriter() throws IOException {
	if (this.writer == null) {
		String characterEncoding = getCharacterEncoding();
		this.writer = (characterEncoding != null ? new ResponsePrintWriter(characterEncoding) :
				new ResponsePrintWriter(WebUtils.DEFAULT_CHARACTER_ENCODING));
	}
	return this.writer;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:ShallowEtagHeaderFilter.java

示例3: createTargetUrl

/**
 * Create the target URL by checking if the redirect string is a URI template first,
 * expanding it with the given model, and then optionally appending simple type model
 * attributes as query String parameters.
 */
protected final String createTargetUrl(Map<String, Object> model, HttpServletRequest request)
		throws UnsupportedEncodingException {

	// Prepare target URL.
	StringBuilder targetUrl = new StringBuilder();
	if (this.contextRelative && getUrl().startsWith("/")) {
		// Do not apply context path to relative URLs.
		targetUrl.append(request.getContextPath());
	}
	targetUrl.append(getUrl());

	String enc = this.encodingScheme;
	if (enc == null) {
		enc = request.getCharacterEncoding();
	}
	if (enc == null) {
		enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
	}

	if (this.expandUriTemplateVariables && StringUtils.hasText(targetUrl)) {
		Map<String, String> variables = getCurrentRequestUriVariables(request);
		targetUrl = replaceUriTemplateVariables(targetUrl.toString(), model, variables, enc);
	}
	if (isPropagateQueryProperties()) {
	 	appendCurrentQueryParams(targetUrl, request);
	}
	if (this.exposeModelAttributes) {
		appendQueryProperties(targetUrl, model, enc);
	}

	return targetUrl.toString();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:37,代碼來源:RedirectView.java

示例4: encodeUrlPathSegment

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,代碼行數:10,代碼來源:NfcIndexController.java

示例5: getCharacterEncoding

public String getCharacterEncoding() {
	String enc = super.getCharacterEncoding();
	return (enc != null ? enc : WebUtils.DEFAULT_CHARACTER_ENCODING);
}
 
開發者ID:penggle,項目名稱:xproject,代碼行數:4,代碼來源:RereadableStreamHttpServletRequest.java

示例6: getCharacterEncoding

@Override
public String getCharacterEncoding() {
	String enc = super.getCharacterEncoding();
	return (enc != null ? enc : WebUtils.DEFAULT_CHARACTER_ENCODING);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:AbstractRequestLoggingFilter.java


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