tags:

views:

200

answers:

1

Can some one please explain how to do integrate TinyMCE in Struts application?

1.I have downloaded the tinyMCE

2.I added tiny_mce.js in my java script folder. 3. In my jsp , I added this line
< SCRIPT LANGUAGE="JavaScript" SRC="jsp/js/tiny_mce.js">

  1. I have just one text area named "contactComments"

I still don't see rich text box.

Ps: Do I need to place entire tinymce folder in to my Javascript folder in the project setting? I only put timy_mce.js

A: 

It should be something like:

<SCRIPT LANGUAGE="JavaScript" SRC="jsp/js/tiny_mce.js">
<SCRIPT LANGUAGE="JavaScript" SRC="jsp/js/tiny_mce_config.js">

And then you use the config file to specify the preferences of TinyMCE for that page. If you want TinyMCE to replace any textbox, you need the preference:

mode : "textareas",

My entire config for example is:

tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    plugins : "table,paste,fullscreen",
    relative_urls : true,
    convert_urls : false,
    // So we can put the google maps in the page
    extended_valid_elements : "iframe[src|width|height|name|align]",

    // Theme options
    theme_advanced_buttons1 : "code,|,cut,copy,pastetext,|,link,unlink,anchor,image,charmap,|,fullscreen",
    theme_advanced_buttons2 : "bold, italic, underline,|, bullist, numlist,|,outdent,indent,|,formatselect",
    theme_advanced_buttons3 : "tablecontrols",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left" 
});

I think you should read the TinyMCE documentation a bit more carefully, this is all explained.

me_here