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

姑苏区住房和建设局网站用vs做网站界面

姑苏区住房和建设局网站,用vs做网站界面,无锡军自考网站建设,火车票网站建设多少钱应用场景&#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.hyszgw.com/news/59525/

相关文章:

  • 商丘建设厅网站首页惠城中山网站建设
  • 营销展示型网站模板中山营销型网站
  • 邵阳市住房和建设局网站怎样先做网站后买域名
  • 怎么建设淘宝那样的网站知名网站建设联系电话
  • 做个电商网站乐平城市建设局网站
  • 建设银行官方网站首页jsp网站开发详解 pdf
  • 网站审核备案财务公司名字
  • 网站建设费与无形资产网站建设资料填写
  • 了解网站建设的流程wordpress 调用浏览数
  • 神魔网站建设荆门网站建设 金键盘
  • 对网站开发的理解市场营销计划方案
  • 如何将网站添加到域名建网站的公司服务
  • 发布网站需要多少钱crm软件哪家好
  • 易思企业网站管理企业营销策划推广
  • 乐山做网站网络推广活动策划方案范文
  • 官网网站建设企业百度云超级会员试用1天
  • 吉安网站推广徽hyhyk1做游戏开发需要学哪些技术
  • 做网站导航用什么开元程序在什么网站做推广
  • 如何做国外的社交网站搜狗关键词优化软件
  • 配色设计网站推荐南京网站开发南京乐识不错
  • 搜什么关键词能找到网站米可网络科技有限公司
  • 网站建设公司海外吴兴区建设局网站
  • 虚拟钱包对接网站开发视频教程佛山网站建设佛山网站制作
  • 保定模板建站哪家好h5 移动 网站 开发
  • 傻瓜式搭建网站外卖网站 模板
  • 金银饰品那家网站做的好wordpress 添加模块
  • 南通建设网站哪家好wordpress快递主题
  • 哪些网站做机票酒店有优势浏览器下载大全
  • 什么网站做跨境电子商务安徽省住房和城乡建设厅网站查询
  • 网页制作与网站建设技术大全易语言怎么做点击按钮打开网站