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

虚拟主机网站建设步骤?怎么在网上做推广

虚拟主机网站建设步骤?,怎么在网上做推广,做食品的采购员常用网站,好网站建设公司地址我今天花了很多时间来弄清楚如何在运行在JBoss上的JSF应用程序中#xff08;使用JBoss 7 Final#xff09;强制正确解码编码的字符。 当您有例如通过URL传递中文字符时#xff0c;就会出现此问题。 假设您有指点事件#xff0c;编码为#xff05;E6#xff05;8C#xf… 我今天花了很多时间来弄清楚如何在运行在JBoss上的JSF应用程序中使用JBoss 7 Final强制正确解码编码的字符。 当您有例如通过URL传递中文字符时就会出现此问题。 假设您有指点事件编码为E68C87E4BA8B。 令人惊讶但是这些字符以指事的形式到达服务器端。 服务器使用ISO-8859-1自动解码它们。 因此如果您尝试像这样自己解码则没关系 FacesContext fc FacesContext.getCurrentInstance(); String param fc.getExternalContext().getRequestParameterMap().get(name); String decodedParam java.net.URLDecoder.decode(param, UTF-8); 这无济于事因为字符已经被错误地解码并且您从请求参数映射中获得了已经被错误解码的字符。 如果您在页面上也没有帮助 meta http-equivContent-Type contenttext/html; charsetUTF-8/ 要克服此错误您需要做两件事特殊的字符编码过滤器和JBoss的standalone.xml中的配置。 过滤器应同时为请求和响应设置配置的编码。 public class CharacterEncodingFilter implements Filter {/** The default character encoding to set for request / response. */private String encoding null;/** The filter configuration object. */private FilterConfig filterConfig;/** Should a character encoding specified by the client be ignored? */private boolean ignore true;public void destroy() {encoding null;filterConfig null;}public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,ServletException {// conditionally select and set the character encoding to be usedif ((ignore || (request.getCharacterEncoding() null)) (encoding ! null)) {request.setCharacterEncoding(encoding);response.setCharacterEncoding(encoding);}// pass control on to the next filterchain.doFilter(request, response);}public void init(FilterConfig filterConfig) throws ServletException {this.filterConfig filterConfig;this.encoding filterConfig.getInitParameter(encoding);String value filterConfig.getInitParameter(ignore);this.ignore ((value null) || value.equalsIgnoreCase(true) || value.equalsIgnoreCase(yes));} } 注意如果仅设置请求的编码则无济于事。 您还应该通过response.setCharacterEncodingencoding将其设置为响应。 web.xml中的配置看起来像 filterfilter-nameCharacterEncodingFilter/filter-namefilter-classxyz.mypackage.CharacterEncodingFilter/filter-classinit-paramdescriptionoverride any encodings from client/descriptionparam-nameignore/param-nameparam-valuetrue/param-value/init-paraminit-paramdescriptionthe encoding to use/descriptionparam-nameencoding/param-nameparam-valueUTF-8/param-value/init-param /filter filter-mappingfilter-nameCharacterEncodingFilter/filter-nameurl-pattern*.jsf/url-pattern /filter-mapping 现在您必须在关闭extensions标记之后直接将以下系统属性添加到standalone.xml中 system-propertiesproperty nameorg.apache.catalina.connector.URI_ENCODING valueUTF-8/property nameorg.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING valuetrue/ /system-properties 从文档中 org.apache.catalina.connector.URI_ENCODING指定xx解码URL后用于解码URI字节的字符编码。 如果未指定将使用ISO-8859-1。 org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING指定是否应将contentType中指定的编码用于URI查询参数而不是使用org.apache.catalina.connector.URI_ENCODING。 出现此设置是为了与Tomcat 4.1.x兼容其中在contentType中指定的编码或使用Request.setCharacterEncoding方法显式设置的编码也用于URL中的参数。 默认值为false。 现在JBoss看起来为响应设置了字符编码并使用它来解码URL参数。 希望此信息可以帮助您节省时间。 参考 在JBoss中 我们的JCG合作伙伴 Oleg Varaksin在软件开发博客Thoughts上 对服务器端URL参数的正确解码 。 翻译自: https://www.javacodegeeks.com/2013/07/proper-decoding-of-url-parameters-on-the-server-side-in-jboss.html
http://www.yutouwan.com/news/3635/

相关文章:

  • 微信网站开发设计网站广告投放收费标准
  • 做网站用什么软件编辑申请建设网站的报告
  • 网站无后台可以上框架如何建立本地网站
  • 泉州市建设网站wordpress收不到邮箱验证
  • 东莞做网站那家好客户管理crm系统哪家好
  • 企业网站建设方案论文天津市建设工程监理公司网站
  • 响应式企业网站设计与实现网站导航栏内容
  • 文明网站建设情况报告wordpress 邮件通知 密码
  • 工信部网站域名备案查询系统jsp 网站开发例子
  • 深圳北网站建设开发公司让员工顶名买房套取贷款
  • 烟台做网站推广的公司哪家好官网如何推广
  • 谈谈对电子商务网站建设的理解科技软件公司网站模板下载
  • qq网站推广代码建筑工程网库
  • 网站建设中所需条件有创意的文创产品
  • 做旅游宣传不错的网站网站建设开发报告论文
  • 建设企业网站企业网上银行助手下载网站标签怎么做
  • 微网站制作提供商推荐软件开发报价明细
  • 南宁网站建设找哪家开旗wordpress pdf缩略图
  • 卖房网站母亲节做什麽活动做网站的ui
  • iis中怎样配置网站绑定分析网站示例
  • 广东省建设厅投诉网站thinkphp cms开源系统
  • 中国移动网站建设建设合同网上备案上哪个网站
  • 聚财的公司名字大全肇庆网页关键词优化
  • 怎么自己做单页网站太原建设设计公司网站
  • 网站首页快照不更新装修流程先后顺序
  • 做网络教育录播网站自己想申请一个公司
  • 做网站的基本功百度网盘客户端下载
  • 青海省住房和城乡建设厅网站网站后台用什么浏览器
  • 网站站长 感受注册域名的网站有哪些
  • 网站开发培训太原wordpress企业官网主题下载