gpt4 book ai didi

java - 更新ckeditor并将其与jsp集成

转载 作者:行者123 更新时间:2023-11-30 08:04:38 24 4
gpt4 key购买 nike

我正在使用旧版本的ckeditor(fckeditor 2.x)集成在带有jsp和struts框架的java项目中。现在我需要使用新版本的 ckeditor 更新项目。我尝试按照文档here中所述进行操作但没有按预期工作。

我已经下载了最新的ckeditor并将其放置在Web应用程序目录中,然后下载了jar文件,将其放置在WEB-INF/lib文件夹中并将其添加到eclipse上的项目中。

在我要添加的 jsp 文件中:

<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>

然后在正文中我尝试接近此内容:(在“multipart/form-data”表单内)

<td class="cellcontent">
<bean:define id="propertyValueId" name="formName" property="example" />
<ckeditor:editor instanceName="example" toolbarSet="Default" height="200px">
<jsp:attribute name="value">
<c:out value="${propertyValueId}" escapeXml="false"></c:out>
</jsp:attribute>
</ckeditor:editor>
</td>

这正是我以前所做的,并且在 2.x 版本中工作正常。由于某些属性不再被接受,我尝试过类似的方法。

<td class="cellcontent">
<bean:define id="propertyValueId" name="formName" property="example" />
<ckeditor:editor basePath="/ckeditor/" editor="content" >
<jsp:attribute name="value">
<c:out value="${propertyValueId}" escapeXml="false"></c:out>
</jsp:attribute>
</ckeditor:editor>
</td>

我尝试了下面的简单示例,输出仍然是普通文本区域。

<textarea cols="80" id="editor1" name="editor1" rows="10"></textarea>               
<ckeditor:replace replace="editor1" basePath="/ckeditor/" />

我想我忘记了一些配置或只是 jsp 中缺少一些标签,我已经用谷歌搜索并阅读了这里的每个问题,但我自己无法弄清楚。

最佳答案

我已经找到答案了。对于任何感兴趣的人来说,使用新版本的 ckeditor 就这么简单:

<ckeditor:editor basePath="<%=ckeditor_context %>" editor="content" />

<tr>
<td class="celltitle">
<strong>Example1 </strong>
</td>
<td class="cellcontent">
<textarea class="ckeditor" name="example1"></textarea>
</td>
</tr>

(...)

<tr>
<td class="celltitle">
<strong>Example2 </strong>
</td>
<td class="cellcontent">
<textarea class="ckeditor" name="example2"></textarea>
</td>
</tr>

关于java - 更新ckeditor并将其与jsp集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31321203/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com