Hi,
I would like to know how to force posting of unencoded html to the server when using the FCK taglib in a jsp page.
I read the documentation and found some references at this page :
http://docs.fckeditor.net/FCKeditor_2.x ... on_Options
So, I set up my JSP code like this :
<FCK:editor basePath="/fckeditor" instanceName="editorInstance">
<FCK:config ProcessHTMLEntities="false" />
<jsp:attribute name="value">
<bean:write filter="false" name="myBean" property="htmlContent"/>
</jsp:attribute>
</FCK:editor>
It works ok except that the posted value received on the server side is entities encoded.
So if using ProcessHTMLEntities="false" is not the right way to do, what is the right way ?
Should I decode the value on server side ? How?
Thanks.
Wed, 10/01/2008 - 15:32
#1
Re: JAVA -jsp and html encoding
Re: JAVA -jsp and html encoding
Thanks for your answer.
I found a workaround using :
org.apache.commons.lang
Class StringEscapeUtils
Which allows me to restore the html code.
What I'm now wondering is why the html code is "encoded" when using a request.getParameter( "EditorDefault"); ?
Is it the getParameter() method which "encodes" the html code or is it the client which encoded it to send the http request ?
Is there a particular reason ?
Thanks.
Re: JAVA -jsp and html encoding
Re: JAVA -jsp and html encoding
Sorry, read too quickly.
The fact is that when I do a String html = request.getParameter( "EditorDefault");
on server side (receiving the post from the form as declared in my previous message), what I get contains encoded entities.
It looks like this :
<li><strong>Député à la chambre des lords </strong><br />
Why ?
So I suppose FCKEditor is sort of making html entities encoding using javascript on the client side ?!
How to bypass this behaviour? And why is it so ?
Re: JAVA -jsp and html encoding
I also found this config parameter
HtmlEncodeOutput
http://docs.fckeditor.net/FCKeditor_2.x ... codeOutput
which seems to be exactly what I'm looking for.
I tried it. But it doesn't help.
Re: JAVA -jsp and html encoding
Doesn't work here either. File this as a bug if you want.
FCKeditor does nothing. All encoding is done by the browser. But again you have to search the error in your system because encoding and decoding work transparently.


See these images as a proof:
Attachments: