You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arnaud Cogoluegnes <ac...@sqli.com> on 2007/07/11 15:28:11 UTC

dispatcher setting encoding

Hi all,

 

I've been trying to add FCKEditor to a Struts 2 application but failing as
browsers bump into the BOM at the beginning of the Javascript files.

 

After some investigations, I found that the FCKEditor JavaScript files are
encoded in UTF-8 but the application always returns ISO-8859-1, so the BOM
is not properly handled by the browser. This behavior disappears when I
removed the Struts filter dispatcher (action2): the JS files are returned as
UTF-8 files and the browser handles the BOM correctly.

 

So it seems the filter dispatcher transforms the encoding for all files (if
configured with /* in web.xml), which can cause problem with UTF-8 and BOM.

 

Is there any way to exclude some files from the filtering ? 

 

Thanks,

 

Arnaud


Re: dispatcher setting encoding

Posted by "David Durham, Jr." <da...@gmail.com>.
On 7/11/07, Arnaud Cogoluegnes <ac...@sqli.com> wrote:
> So it seems the filter dispatcher transforms the encoding for all files (if
> configured with /* in web.xml), which can cause problem with UTF-8 and BOM.
>
> Is there any way to exclude some files from the filtering ?

My first guess would be to change the /* to /*.do, or something to
that effect.  Consider this with the caveat that I don't fully
understand the FilterDispatcher.  I think that Filters can now (since
servlets 2.4, I think) be applied to RequestDispatcher.include/forward
calls, so it's possible that changing /* to /*.do would break some
result types or something else, for that matter, but I don't know for
sure.

HTH,

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org