1

Topic: Some JSP code in editor is stripped

Hi,
While developing content for our site, we put some JSP code in HTML. If I paste the JSP code in source view and update it to the editor, some code is stripped/cleaned. Here is an example:

Actual code:
<a href="http://<%=properties.getKeywordValue("SHOPDELUXE_DOMAIN")%>/home.jsp?PROMOCODE=CC035">

After "updating", when I reopen the code view, I see the following:

<a href="http://<%=properties.getkeywordvalue(/">/home.jsp?PROMOCODE=CC035">


Is there a way to instruct TinyMCE to not clean JSP code within the HTML?

Thanks,
Akmal

2

Re: Some JSP code in editor is stripped

It's always the same old and sad song... people mix HTML markup with server-side code and expect TinyMCE (which is in fact a purely client-side application) to handle it correctly as if it were an IDE. I strongly suggest that you divide your code into server-side and client-side parts and put the latter in templates!

Greetings from Germany,

Felix Riesterer.
-- I am neither Moxiecode nor Ephox! --

3

Re: Some JSP code in editor is stripped

I can't understand why. WHYYY!! I mean simple things might work such as <a title="<%somecode()%>"> but complex things like this will never work since then we need to make a JSP interpreter in JavaScript:

<table>
<%for (int i = 0; i < 10; i++) {%>
<tr>
<td>X</td>
</tr>
<%}%>
</table>

So why try at all. End users shouldn't be bothered with JSP logic anyway. There are security implications, it's impractical and makes little sense since you won't get a preview or WYSIWYG experience anyway.

If it's for some template design why not use a non richtext area a simple textbox since the user who is supposed to fiddle with the code needs to be a skilled JSP developer anyway and then they would be able to see all code not hidden away in a richtext environment.

We designed TinyMCE to be used by endusers with little or no knowledge of HTML. So we don't have a focus to make it more complex and handle backend code as well. It's designed to be a richtext editor with wysiwyg capabilities of (X)HTML code. If you need it for something else you need to use thirdparty plugins like the codeprotect plugin that's available at SF.

I've been tempted to add this plugin to the core package of TinyMCE. But when I think of it for a while I understand that it would take this project in the wrong direction. We don't want to go the code editor route and make a dreamweaver application for the web.

Best regards,
Spocke - Main developer of TinyMCE

4

Re: Some JSP code in editor is stripped

@spocke:
I've added this issue to the FAQ.

Greetings from Germany,

Felix Riesterer.
-- I am neither Moxiecode nor Ephox! --

5

Re: Some JSP code in editor is stripped

I don't paste any code only an HTML which had formatted on Outlook. Ex: Signature with some hyperlinks, line with color. After paste into TinyMCE, all format is ignored but i paste on compose box of Yahoo or Google is OK.

Please show me how to config or it's a limitation of Tiny.

Thanks,

6

Re: Some JSP code in editor is stripped

Do you use the latest version and do you use the paste plugin? There are parameters you can/need to set in the plugin.

7

Re: Some JSP code in editor is stripped

I used the lasted version. Only Ctrl-C and Ctrl-V not use paste plugin.

8

Re: Some JSP code in editor is stripped

Then try it out!