- 浏览: 63573 次
- 来自: fantasy
-
最新评论
-
dygf1987:
还有别的原因吗?我的这三个都起来了
ORA-12560:协议适配器错误(oracle10g) -
wyt1213:
按说人种之间不应该存在这种心态的差别,那么,谁的过错造就大众这 ...
我又犯嫉妒了,借用此文鞭策下自己 -
Alrale:
网易安徽宿州网友 ip:6 ...
不内涵,聚光灯在评论处,你们懂得 -
Alrale:
dunhuacc12 写道Alrale 写道dunhuacc1 ...
人的性格真的不可以改变吗? -
dunhuacc12:
Alrale 写道dunhuacc12 写道突然间觉得超女也没 ...
人的性格真的不可以改变吗?
Web components usually use PrintWriter to produce responses; PrintWriter automatically encodes using ISO-8859-1. Servlets can also output binary data using OutputStream classes, which perform no encoding. An application that uses a character set that cannot use the default encoding must explicitly set a different encoding.
For web components, three encodings must be considered:
-
Request
-
Page (JSP pages)
-
Response
Request Encoding
The request encoding is the character encoding in which parameters in an incoming request are interpreted. Currently, many browsers do not send a request encoding qualifier with the Content-Type header. In such cases, a web container will use the default encoding, ISO-8859-1, to parse request data.
If the client hasn’t set character encoding and the request data is encoded with a different encoding from the default, the data won’t be interpreted correctly. To remedy this situation, you can use the
ServletRequest.setCharacterEncoding(String enc)
method to override the character encoding supplied by the container.
To control the request encoding from JSP pages, you can use the JSTL
fmt:requestEncoding
tag.
You must call the method or tag before parsing any request parameters or reading any input from the request. Calling the method or tag once data has been read will not affect the encoding.
Page Encoding
For JSP pages, the page encoding is the character encoding in which the file is encoded.
For JSP pages in standard syntax, the page encoding is determined from the following sources:
-
The page encoding value of a JSP property group (see Setting Properties for Groups of JSP Pages) whose URL pattern matches the page.
-
The pageEncoding attribute of the page directive of the page. It is a translation-time error to name different encodings in the pageEncoding attribute of the page directive of a JSP page and in a JSP property group.
-
The CHARSET value of the contentType attribute of the page directive.
If none of these is provided, ISO-8859-1 is used as the default page encoding.
The pageEncoding and contentType attributes determine the page character encoding of only the file that physically contains the page directive. A web container raises a translation-time error if an unsupported page encoding is specified.
Response Encoding
The response encoding is the character encoding of the textual response generated by a web component. The response encoding must be set appropriately so that the characters are rendered correctly for a given locale. A web container sets an initial response encoding for a JSP page from the following sources:
-
The CHARSET value of the contentType attribute of the page directive
-
The encoding specified by the pageEncoding attribute of the page directive
-
The page encoding value of a JSP property group whose URL pattern matches the page
If none of these is provided, ISO-8859-1 is used as the default response encoding.
The setCharacterEncoding, setContentType, and setLocale methods can be called repeatedly to change the character encoding. Calls made after the servlet response’s getWriter method has been called or after the response is committed have no effect on the character encoding. Data is sent to the response stream on buffer flushes (for buffered pages) or on encountering the first content on unbuffered pages.
Calls to setContentType set the character encoding only if the given content type string provides a value for the charset attribute. Calls to setLocale set the character encoding only if neither setCharacterEncoding nor setContentType has set the character encoding before. To control the response encoding from JSP pages, you can use the JSTL fmt.setLocale tag.
To obtain the character encoding for a locale, the setLocale method checks the locale encoding mapping for the web application. For example, to map Japanese to the Japanese-specific encoding Shift_JIS, follow these steps:
-
Select the WAR.
-
Click the Advanced Settings button.
-
In the Locale Character Encoding table, Click the Add button.
-
Enter ja in the Extension column.
-
Enter Shift_JIS in the Character Encoding column.
If a mapping is not set for the web application, setLocale uses a Application Server mapping.
The first application in Chapter 5, JavaServer Pages Technology allows a user to choose an English string representation of a locale from all the locales available to the Java 2 platform and then outputs a date localized for that locale. To ensure that the characters in the date can be rendered correctly for a wide variety of character sets, the JSP page that generates the date sets the response encoding to UTF-8 by using the following directive:
<%@ page contentType="text/html; charset=UTF-8" %>
发表评论
-
【转载】cpu 硬件同步原语(compare and swap)
2012-03-13 08:38 2011cpu 硬件同步原语(compare and swap) 支 ... -
转载 web.xml元素:常见设定值一览
2010-08-05 19:40 830本文对web.xml元素中的常 ... -
SCJP拾遗(一) 默认构造函数的访问权限
2010-06-02 14:10 3022Java 类 (1)如果没有指定构造函数,编译时会自动创建一 ... -
Html元素<textarea>内回车的处理
2010-04-08 09:08 2685做事从小事入手,从细节入手. Html元素<te ... -
对给定的数字(float)四舍五入到小数点后两位
2010-02-03 13:29 1315float f = 123.456f; float f1 ... -
"Page Encoding","contentType"的区别
2009-09-14 10:16 1519SUN官方解释(见《The Java EE 5 Tutoria ... -
Jdbc demo
2008-10-24 16:02 1262String url = "jdbc:mysql:/ ... -
Java Exception 继承关系图
2008-10-16 17:43 2938[img]/upload/attachment/42963/5 ... -
Log4j 总结(六) log4j 之 WriterAppender
2008-10-16 10:33 1804public class WriterAppender ext ... -
Log4j 总结(五) log4j 之 配置文件
2008-10-16 10:21 1152前面几个都是概念,现在是实战 Log4j支持两种格式的配置文件 ... -
Log4j 总结(四) log4j 之 Appenders and Layouts
2008-10-16 09:49 923Logger Name Added Appenders ... -
Log4j 总结(三) log4j 之 Logger
2008-10-16 09:36 1114Loggers are named entities. Log ... -
Log4j 总结(一) log4j特色
2008-10-16 08:47 1141One of the distinctive features ... -
Log4j 总结(二) log4j主要的三个组件
2008-10-07 14:12 956Log4j has three main components ... -
检测指定URL是否有效连接的JAVA代码
2008-09-09 17:26 4686try{ URL url = new URL(url_s); ... -
Jsp的执行过程
2008-09-09 16:03 2308JSP 的执行过程 (1) 客户端发出Request (请求) ... -
Servlet 2.4 对比 2.3 的改变
2008-09-09 15:56 27312003年11月底,J2EE 1.4规范正式发布,Servle ... -
Tomcat 各版本支持的Servlet规范
2008-09-09 15:43 1490Servlet/JSP Spec Apache ... -
Servlet 的生命周期 (摘自JSP2.0技术手册)
2008-09-09 15:25 989(1) 产生 Servlet,加载到Servlet Engin ...
相关推荐
在 `File > Default Settings > Code Style` 下,找到 `General` 和 `Python` 相关设置,勾选 `Use tab character` 来使用 Tab 字符作为缩进。 ##### 7. 关闭默认代码折叠 在 `Code Folding` 分类中,取消勾选 `...
cmd-bat-批处理-脚本-IE主页修改.zip
Delphi 12.3控件之uniGUI-Extras_1.95.0.1600.rar
内容概要:本文主要介绍了SQL注入的概念、危害及其防范措施。SQL注入是攻击者通过恶意构造输入,使服务器执行非预期的SQL命令的一种攻击方式,常因用户输入未
使用方法:拷贝到Auto CAD的Fonts下
cmd-bat-批处理-脚本-维护版.zip
解压
内容概要:本文档为《mysql.docx》,主要汇总了MySQL的各类常用命令,分为基础命令、数据库相关命令、数据表相关命令和事务相关命令四大部分。基础命令涵盖了连接、创建、删除数据库,创建和删除表,插入、查询、更新、删除数据等基本操作;数据库相关命令则进一步细化了对数据库的管理操作,如修改编码格式、查看数据库详细信息等;数据表相关命令着重介绍了对表结构和数据的操作,包括创建、修改、删除表,添加、删除、修改列,创建和删除索引等;事务相关命令主要涉及事务的开始、提交、回滚,设置事务隔离级别,以及表的锁定与解锁操作。; 适合人群:适用于具有一定SQL基础,尤其是MySQL使用经验的数据库管理员或开发人员。; 使用场景及目标:①帮助用户快速查找并正确使用MySQL的各种命令;②提高用户对MySQL数据库的操作能力,包括但不限于数据库和表的创建、修改、删除,数据的增删改查等;③掌握MySQL事务处理机制,确保数据的一致性和完整性。; 其他说明:本文档是MySQL命令的集合,建议用户在实际操作前先熟悉各个命令的具体用法,并在测试环境中进行练习,避免误操作导致数据丢失或其他严重后果。
cmd-bat-批处理-脚本-交换两个变量的值而不使用临时变量.zip
内容概要:集成测试是确保软件质量的关键环节,它在单元测试基础上验证模块间的交互和协作。文章详细介绍了集成测试的目的、重要性、流程步骤、策略与方法以及常见问题的解决办法。集成测试不仅验证模块接口的正确性,还确保系统的整体功能和性能符合预期。文章通过一个电商系统的实际案例,展示了集成测试在发现和解决问题中的具体应用。最后,展望了集成测试未来的发展趋势,如自动化测试、云计算、大数据和人工智能技术的应用。 适合人群:软件开发人员、测试工程师、项目经理及相关技术人员。 使用场景及目标:①了解集成测试在整个软件开发生命周期中的作用和重要性;②掌握集成测试的详细流程,包括测试计划制定、环境搭建、用例设计、执行与记录、缺陷管理和回归测试、测试总结与报告;③学习集成测试的不同策略(自顶向下、自底向上、混合策略)和方法(黑盒测试、白盒测试、模拟测试),并理解其适用场景;④掌握常见问题(接口不匹配、数据传递错误、性能瓶颈)的解决办法。 其他说明:本文不仅提供了集成测试的理论知识,还结合实际案例进行详细讲解,帮助读者更好地理解和应用集成测试技术。未来集成测试将受益于自动化测试、云计算、大数据和人工智能技术的发展,测试人员应不断学习新技术,优化测试流程,提高软件质量和效率。
cmd脚本-bat批处理-快速设定分辨率.zip
内容概要:本文献为电子科技大学硕士学位论文,题目为“高阶过采样delta-sigma DAC设计”。论文首先介绍了DAC的基本概念及其多种结构,重点阐述了delta-sigma DAC的优势,包括实现24位以上量化精度、简化模拟部分设计等。接着详细探讨了delta-sigma DAC的核心组成部分——过采样和噪声整形。过采样部分采用8倍插值8倍采样保持结构,其中插值器由2倍和4倍插值器级联构成;噪声整形部分采用5阶结构,优化了零点和极点,形成前馈加局部振荡反馈的噪声整形环。论文还介绍了在Matlab中完成的数字模型和FPGA平台上实现的硬件设计,最终实现了16位数据位宽、信噪比为95.53dB的delta-sigma DAC。 适合人群:具备一定电子工程和数字信号处理基础,特别是对DAC设计感兴趣的研究生或研究人员。 使用场景及目标:①适用于研究高精度数模转换技术的学术机构;②为设计高阶过采样delta-sigma DAC提供理论和技术支持;③探索delta-sigma技术在音频和其他高精度应用领域的潜力。 阅读建议:此资源不仅涉及复杂的理论分析,还包括详细的硬件实现步骤,建议读者在理解基本概念的基础上逐步深入,结合Matlab仿真和FPGA实现进行实践,以加深对delta-sigma DAC设计的理解。
cmd-bat-批处理-脚本-弹出对话框.zip
提供一个ARIMA模型的MATLAB代码示例,该代码能够根据用户自身的具体需求灵活调整参数,从而达到预期的分析效果。
cmd-bat-批处理-脚本-倒记时(全屏).zip
ssm+vue图书管理系统全套源码+毕业论文+数据库sql,全套毕设,非常具有参考意义
cmd-bat-批处理-脚本-更改电源管理方式.zip
cmd-bat-批处理-脚本-禁止用XP的图片视频预览功能.zip
i.MX93外设驱动程序,一分价钱一分货,项目代码可顺利编译运行~
cmd-bat-批处理-脚本-显示进度.zip