Easy FCKEditor使用问题
?????? 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是//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.5try {String context = servletContext.getContextPath();applCtx = context + "/";} catch (Throwable throwable) { //Default to root contextapplCtx = "/";}}this.applicationContext = applCtx;
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, 果然问题就解决了。
?
??? 下篇将专门说明上传文件的配置, 这也困扰我很长时间。
?