Easy FCKEditor是一个Tapestry组件,它使FCKEditor能方便的在Tapestry中使用,几乎支持FCKEditor所有的功能,包括文件上传。其官方网站为 http://t5-easy-fckeditor.kenai.com/。
目前Easy FCKEditor的最新版本为1.0.4, 支持Tapestry 5.1.0.5. 使用是请注意这一点。基本使用是相当简单,请看官方例子http://t5-easy-fckeditor.kenai.com/Simple.html; 我就不在此嗷述了。
简单说下我使用中碰到的问题。
1. 在本机winxp, tomcat6工作的很好,但是放到linux服务器却出错,Editor根本没有办法显示找不到页面"/assets/easyfck/fckeditor/editor/fckeditor.html?InstanceName=fckeditor&Toolbar=Default". 刚开始一直不得其解,后仔细比较了下本机正确显示,确实是没有这个路径啊! /assert 前面少了站点的Context名称。
郁闷中不得不看Easy FCKEditor的源码,一番折腾发现,FCKEditor的basedir是FckEditorService 的getApplicationContext()方法取到的。其实现类中有如下代码:
//Has the application context been given by the client module?
String applCtx = "";
try {
applCtx = symbolSource.valueForSymbol( FckEditorConstants.APPLICATION_CONTEXT );
} catch (RuntimeException re) {
//Try to use the getContextPath method that was introduced in servlet spec 2.5
try {
String context = servletContext.getContextPath();
applCtx = context + "/";
} catch (Throwable throwable) { //Default to root context
applCtx = "/";
}
}
this.applicationContext = applCtx;
显然applicationContext是先取FckEditorConstants.APPLICATION_CONTEXT ,取不到则取servletContext.getContextPath(),如果还是取不到,就是"/".
所以现在可以明确 linux上跑的时候,servletContext.getContextPath();肯定没有取到。为什么呢? 为了搞清这个问题,我改了代码专门打印这个servletContext.getContextPath(); 发现改方法确实抛了异常,如下,
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at code.review.web.pages.AssignToMe.getSource(AssignToMe.java:38)
at $PropertyConduit_12b2ed25516.get($PropertyConduit_12b2ed25516.java)
at org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:58)
at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.read(InternalComponentResourcesImpl.java:510)
at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.read(InternalComponentResourcesImpl.java:496)
at code.review.web.components.ItemList._$read_parameter_source(ItemList.java)
at code.review.web.components.ItemList.getSource(ItemList.java:71)
at code.review.web.components.ItemList.getReviewItems(ItemList.java:78)
at $PropertyConduit_12b2ed254f3.get($PropertyConduit_12b2ed254f3.java)
at org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:58)
at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.read(InternalComponentResourcesImpl.java:510)
at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.read(InternalComponentResourcesImpl.java:496)
at org.apache.tapestry5.corelib.components.Grid._$read_parameter_source(Grid.java)
at org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:442)
at org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:428)
at org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java)
并且Tomcat启动时,有异常信息如下,
INFO: validateJarFile(...../WEB-INF/lib/geronimo-servlet_2.5_spec-1.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Google了一下,怀疑Linux上的Tomcat5.27版本低了,换成tomcat6, 果然问题就解决了。
下篇将专门说明上传文件的配置, 这也困扰我很长时间。
分享到:
相关推荐
【标签】"easyf easy_" 指出这个集成是易于使用的,"EasyF"可能是FCKeditor在T5框架中的特定实现或者是一个简化版,目的是为了简化开发者的工作流程,使FCKeditor在T5中的配置和使用更加简单。 【压缩包子文件的...
- `FCKeditor 2.6.3`:`http://easynews.dl.sourceforge.net/FCKeditor_2.6.3.zip` - `FCKeditor for Java 2.4`:`http://switch.dl.sourceforge.net/fckeditor-java-2.4-bin.zip` #### 三、安装与部署 在部署...
在这一版本中我们完全实现了与轻松互联网开发平台的无缝整合,在平台中调用FCKeditor跟使用标签一样Easy(例子文件在_samples/editor目录下)。而且没给恶意攻击者留任何可能的漏洞。 另外,对重点功能也进行扩展,...
sections or categories- Attach links to articles, sections or categories- A comprehensive set of UBB-like codes are available to beautify your posts- Integrated support of TinyMCE and of FCKEditor-...
* Compatible with TinyMCE, FCKeditor, WYMeditor and QuickTags * tags management (rename, delete, merge, search and add tags, edit tags ID) * **Edit mass tags (more than 50 posts once)** * Auto ...