当前位置: 首页>>代码示例>>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;未经允许,请勿转载。