JS代码:

<script type="text/javascript" src="${pageContext.request.contextPath}/fckeditor/fckeditor.js"></script>
 <script type="text/javascript">
  $(function(){
       var oFCKeditor = new FCKeditor( 'content' ) ; 
   oFCKeditor.BasePath = "${pageContext.request.contextPath}/fckeditor/" ; // 必须设置这个属性,表示editor文件夹所在的路径,一定要以'/'结尾
   oFCKeditor.Height = "95%" ;
   oFCKeditor.Width = "95%" ;
   oFCKeditor.ToolbarSet = "bbs"; // 默认为"Default",此参数是在myconfig.js中的,fckconfig.js文件中引用了myconfig.js文件,myconfig.js中的设置覆盖默认设置
   // oFCKeditor.Value = 'Hello World!' ;
   // oFCKeditor.Create() ; // 生成并在当前位置显示FCKeditor
   oFCKeditor.ReplaceTextarea(); // 替换指定的name="content"的textarea元素
  });
 </script>

 

jsp显示代码:

<tr height="240">
      <td class="InputAreaBg"><div class="InputTitle">内容</div></td>
      <td class="InputAreaBg">
       <div class="InputContent">
        <s:textarea name="content" cssStyle="width:650px;height:200px"></s:textarea>
       </div>
      </td>
 </tr>