We need to be able to load HTML-formatted text from a database and populate FCKEditor with this text, within our Struts 2 framework. For example, I entered this text into FCKEditor:
this is bold, this is normal
When I retrieve the text from the form for insertion/update into the database, the text appears as I'd reasonably expect:
<p><strong>this is bold</strong> this is normal</p>
I am currently doing this with the Struts 2 tags:
<FCK:editor id="pageText" height="400" width="600" toolbarSet="Default" >
<s:property value="pageText"/>
</FCK:editor>
What happens when the text is retrieved from the database and populated in the form is that it shows up as:
<p><strong>this is bold</strong> this is normal</p>
instead of
this is bold, this is normal
Is there a property in the <FCK:editor> tag or the fckconfig.js file that can be set to get the expected output? Or do I need to do something else?
this is bold, this is normal
When I retrieve the text from the form for insertion/update into the database, the text appears as I'd reasonably expect:
<p><strong>this is bold</strong> this is normal</p>
I am currently doing this with the Struts 2 tags:
<FCK:editor id="pageText" height="400" width="600" toolbarSet="Default" >
<s:property value="pageText"/>
</FCK:editor>
What happens when the text is retrieved from the database and populated in the form is that it shows up as:
<p><strong>this is bold</strong> this is normal</p>
instead of
this is bold, this is normal
Is there a property in the <FCK:editor> tag or the fckconfig.js file that can be set to get the expected output? Or do I need to do something else?

Re: FCKEditor and Struts 2: How to set the editor's source text?
<fck:editor id="cuerpo" basePath="/MuseoWeb/FCKeditor/" fontNames=";Arial;Courier New;Times New Roman;Verdana" toolbarSet="Basic" defaultLanguage="gl" enableSourceXHTML="true" enableXHTML="true" width="80%"> <c:out value="${NoticiaForm.cuerpo}" escapeXml="false"/> </fck:editor>I'm using this with an ActionForm called NoticiaForm, to edit a String attribute called cuerpo
The trick is the escapeXml attribute, it tells the server to not change all tags like <p> or <b> with forbidden characters ('<' and '>') for their html code equivalents.
Hope this helps.
Re: FCKEditor and Struts 2: How to set the editor's source text?
Thank you!
Re: FCKEditor and Struts 2: How to set the editor's source text?