【问题标题】:How to integrate TinyMCE is Struts applicationTinyMCE如何集成Struts应用
【发布时间】:2009-12-07 14:25:05
【问题描述】:

谁能解释一下如何在 Struts 应用程序中集成 TinyMCE?

1.我已经下载了tinyMCE

2.我在我的 java 脚本文件夹中添加了 tiny_mce.js。 3. 在我的 jsp 中,我添加了这一行

  1. 我只有一个名为“contactComments”的文本区域

我仍然看不到富文本框。

Ps:我是否需要将整个 tinymce 文件夹放入项目设置中的 Javascript 文件夹中? 我只放了timy_mce.js

【问题讨论】:

  • 我认为你在“我添加了这一行”之后遗漏了一些东西。是的,您需要的不仅仅是 tiny_mce.js。
  • 谢谢你。所以,我们需要的不仅仅是 tiny_mce.js。我会再试一次

标签: tinymce


【解决方案1】:

应该是这样的:

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

然后您使用配置文件为该页面指定 TinyMCE 的首选项。如果您希望 TinyMCE 替换任何文本框,则需要首选项:

mode : "textareas",

我的整个配置例如是:

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"   
});

我认为您应该更仔细地阅读 TinyMCE 文档,这一切都已经解释过了。

【讨论】:

    猜你喜欢
    • 2020-03-13
    • 1970-01-01
    • 2011-08-15
    • 1970-01-01
    • 2012-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-28
    相关资源
    最近更新 更多