---
title: "RichFaces在FireFox下Error decode resource data异常的解决方法"
author: "chainhou"
date: "2012-12-03T13:09:27Z"
tags: []
categories: ["Web前端"]
slug: "richfaces-firefox-error-decode-resource-data"
draft: false
lastmod: "2012-12-03T13:09:27Z"
id: 1740111
url: "https://chainhou.iteye.com/blog/1740111"
---

当WEB应用使用RichFaces出现如下异常：
javax.faces.FacesException: Error decode resource data
时，
该问题是由于RichFaces在FireFox中 "!" encoded as "%21"，解码时出错了，在其它浏览器正常 
官方解释：Tracing into ResourceBuilderImpl.decrypt shows that FF11 gives us strings where the exclamation point "!" is encoded as "%21". IOW there is a call to URLDecoder.decode missing somewhere
可以通过更新
richfaces-impl-3.3.1.GA.jar 下面的WebXml.class来解决。
增加代码如下：
String s = getFacesResourceKey(resourcePath); 
    if (null != s) 
      try { 
        return URLDecoder.decode(s, "ISO-8859-1"); 
      } 
      catch (UnsupportedEncodingException e) 
      { 
      } 
    return null;

解决方案出处：https://issues.jboss.org/browse/RF-12062