当前位置: 首页 > news >正文

杭州网站建设网站制作网站建设绪论

杭州网站建设网站制作,网站建设绪论,杭州做绒毛鉴定网站,h5页面制作代码应用场景&#xff1a;在遇到中文问题时&#xff0c;常需要通过设置编码格式来解决问题。下面介绍TongWeb8的编码设置及优先级。一、web.xml中请求、响应编码的配置优先级最高在JavaEE8规范中web.xml增加了request, response编码配置&#xff0c;该配置优先级最高。<?xml ve…

应用场景:

在遇到中文问题时,常需要通过设置编码格式来解决问题。下面介绍TongWeb8的编码设置及优先级。

一、web.xml中请求、响应编码的配置优先级最高

在JavaEE8规范中web.xml增加了request, response编码配置,该配置优先级最高。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://xmlns.jcp.org/xml/ns/javaee"xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"id="WebApp_ID" version="4.0"><display-name>charset</display-name><default-context-path>/testde</default-context-path><request-character-encoding>GBK</request-character-encoding><response-character-encoding>GBK</response-character-encoding>  

以往项目中request, response编码通常通过filter来设置,如:

    <filter-name>EncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param><init-param><param-name>forceEncoding</param-name><param-value>true</param-value></init-param>

二、TongWeb8控制台编码设置

在部署应用时通过配置"编码"来完成。

参数

参数说明

应用请求编码

应用程序的默认 HTTP 请求编码,优先级低于web.xml。

应用响应编码

应用程序的默认HTTP响应体编码,优先级低于web.xml。

JSP 文件编码

指定 JSP 文件编码, 相当于javaEncoding。

静态文件编码

使用指定的编码解析应用的文件资源,如 *.html 等静态资源,可用于解决文件编码和 JVM 默认编码不一致引起的乱码问题。相当于fileEncoding

三、URL编码设置

为兼容tomcat编码,http通道中"其它" 中的"URI 编码" 相当于tomcat的URIEncoding ;“URI 使用 Content-Type 解码" 相当于tomcat的useBodyEncodingForURI。

若tomcat下不乱码,而在TongWeb下乱码,则可参考tomcat配置来配置TongWeb。

URIEncoding : This specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. The default value is UTF-8.

useBodyEncodingForURI :
This specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding. This setting is present for compatibility with Tomcat 4.1.x, where the encoding specified in the contentType, or explicitly set using Request.setCharacterEncoding method was also used for the parameters from the URL. The default value is false.
Notes: 1) This setting is applied only to the query string of a request. Unlike URIEncoding it does not affect the path portion of a request URI. 2) If request character encoding is not known (is not provided by a browser and is not set by SetCharacterEncodingFilter or a similar filter using Request.setCharacterEncoding method), the default encoding is always "ISO-8859-1". The URIEncoding setting has no effect on this default.

http://www.yayakq.cn/news/995061/

相关文章:

  • 什么网站可以做ui兼职网络监控管理系统
  • 湘潭网站建设 搜索磐石网络自己做网站要服务器吗
  • 51购物网官方网站网站内容设置
  • 域名没备案如何建设网站小程序模板下载
  • 济南建设网站的公司哪家好把自己做的动画传到哪个网站上
  • 超溜网站建设wordpress 本地配置文件
  • 建设网站公司哪里好制作大型网站开发
  • 企业网站的建立之前必须首先确定网站开发教学网站
  • 福州网站制作套餐做淘客网站多少钱
  • 建设部网站 测绘规章wordpress 迅虎开发
  • 平台做网站点击网站收款即时到账怎么做的
  • 辽源做网站的公司中国建设银行网站会员登录
  • 网站建设注册名有规范吗北京网站建设公司排行
  • 网站打开速度优化韶关网站制作
  • 专门做女频的小说网站网站开发三层结构
  • wordpress站点标题和副标题做课件最好的素材网站
  • 大一python基础编程题北京SEO网站优化公司
  • 网站做二级域名粤康码小程序
  • 婚礼婚庆网站建设简述企业网络建设的流程
  • 网站推广站制作网架厂家
  • 杭州做商业地产开什么网站好群晖wordpress外网仿问设置
  • 汝城网站建设公司怎么做淘宝客手机网站
  • 欧美风格的网站seo网站推广 杭州
  • 长春网站公司有哪些内容常州网站建设公司推荐
  • 摄影招聘网站开一间网站建设有限公司
  • 网络营销推广策略有哪些乐云seo官网
  • 温州市城乡建设厅网站首页柳州柳北建设局网站
  • 信息流广告素材网站深圳设计公司名字
  • 网站上传的流程图郑州画册设计公司
  • 哈尔滨工程建设网北京优化网站