繁体中文
设为首页
加入收藏
当前位置:IT认证首页 >> Sun >> 复习指导 >> 让FCKeditor在JSP和JSF项目中跑起来(下)

让FCKeditor在JSP和JSF项目中跑起来(下)

2007-11-29 22:07:30  作者:itzero  来源:itzero.com  浏览次数:59  文字大小:【】【】【
简介: 四、使用 4.1 使用javascipt替换textarea方法/////////////////////////////////////////////////////<script type="text/javascript" src="<c:url value="/FCKeditor/fckeditor.js"/>"></script> <h ...
关键字:FCKeditor JSP JSF

四、使用

4.1 使用javascipt替换textarea方法
/////////////////////////////////////////////////////
<script type="text/javascript" src="<c:url value="/FCKeditor/fckeditor.js"/>"></script>

<h:form id="newsadd">
<h:outputText value="Title:"/>
<h:inputText value="#{newsAddForm.title }"/>
<br/>
<h:outputText value="Content:"/>
<h:inputTextarea id="content" value="#{newsAddForm.content }" cols="80" rows="5"/>
<br/>
<h:commandButton value="Submit" action="#{newsAddForm.submit }"/>

<script type="text/javascript">
var oFCKeditor = new FCKeditor('newsadd:content') ; //这里设置textarea的id或name
oFCKeditor.BasePath = '<c:url value="/FCKeditor/"/>' ;
oFCKeditor.Height = "80%"; //这里设置高度
oFCKeditor.ToolbarSet = "Default" ;
oFCKeditor.ReplaceTextarea();
</script>
</h:form>
/////////////////////////////////////////////////////

4.2 使用jsf标签
/////////////////////////////////////////////////////
<%@ taglib uri="http://www.fck-faces.org/fck-faces" prefix="fck"%>
<h:form id="form1">
 <fck:editor toolbarSet="Default"  value="#{fckText.text}"  width="80%" height="80%" id="myComponentId" cols="80" rows="18"/>
 
 <h:commandButton action="#{fckText.print}"/>
</h:form>
/////////////////////////////////////////////////////

五、严重注意事项
我的web.xml配置了JSF拦截*.html文件,现在FCKeditor使用了大量的*.html,结果导致
它们都被Faces Servlet拦截了,一个页面都出不来,怎么办呢?
<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.html</url-pattern>
 </servlet-mapping>
 
想来想去,没有什么好办法,唯有把原来项目中使用*.html的全部改为*.jsf,真惨!
不知道你有什么好方法呢?还请发表评论或者来信告知! samland@21cn.com
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.jsf</url-pattern>
 </servlet-mapping>
 
OK, 祝你顺利!

责任编辑:itzero

本文引用地址: http://exam.itzero.com/2007/1129/16888.html 请粘贴到你的QQ/MSN上推荐给你的好友

相关文章
让FCKeditor在JSP和JSF项目中跑起来(中)
让FCKeditor在JSP和JSF项目中跑起来(上)
 

最新文章

更多

· 让FCKeditor在JSP和JSF项...
· 让FCKeditor在JSP和JSF项...
· 使用WebRowSet完成JDBC的...
· 使用WebRowSet完成JDBC的...
· 读取数码照片中的Exif信息
· jsp中forword和sendRedi...
· 让FCKeditor在JSP和JSF项...
· SUN认证课程专业问答
· 写Java程序最容易犯的21...
· 初学者入门 JAVA 的 XML...

热点文章

更多

其它推荐