struts1.2下使用ckeditor部分代码:         <%
     String content = request.getParameter("editor1");
     if (content!=null&&content.equals("")){
     out.println(content);
     }
     %>     <html:textarea cols="80"  name="editor1" rows="10"  property="content">在此添加内容</html:textarea>  <script type="text/javascript">
     CKEDITOR.replace('editor1',
     {
     skin : 'kama',
     language : 'zh-cn'
     });
     </script>运行起来就提示红色的那行有问题,可是我不明白有什么问题啊还有,把html去掉就能显示,但那就不是struts的表单了这到底是肿么了~

解决方案 »

  1.   

    使用html表单既简单,又提高效率,为何不用啊
      

  2.   

    看下生成的静态页面的textarea标签究竟是什么样子的。
      

  3.   

    <%@ page language="java" import="com.fredck.FCKeditor.*" %>
    <%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK" %>
    <script type="text/javascript" src="${pageContext.request.contextPath}/FCKeditor/fckeditor.js"></script><%--
    <form action="show.jsp" method="post" target="_blank">
     <FCK:editor id="content" basePath="/FCKeditor/"
           width="700"
           height="500"
           skinPath="/FCKeditor/editor/skins/silver/"
           toolbarSet = "Default"
     >
     input
            </FCK:editor>
    <input type="submit" value="Submit">
    </form>
    --%><form action="show.jsp" method="post" target="_blank">
    <table border="0" width="700"><tr><td>
    <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">input</textarea>
    <script type="text/javascript">
     var oFCKeditor = new FCKeditor('content') ;
     oFCKeditor.BasePath = "${pageContext.request.contextPath}/FCKeditor/" ;
     oFCKeditor.Height = 400;
     oFCKeditor.ToolbarSet = "Default" ; 
     oFCKeditor.ReplaceTextarea();
    </script>
    <input type="submit" value="Submit">
    </td></tr></table>
    </form><%--
    <form action="show.jsp" method="post" target="_blank">
    <%
    FCKeditor oFCKeditor ;
    oFCKeditor = new FCKeditor( request, "content" ) ;
    oFCKeditor.setBasePath( "/FCKeditor/" ) ;
    oFCKeditor.setValue( "input" );
    out.println( oFCKeditor.create() ) ;
    %>
    <br>
    <input type="submit" value="Submit">
    </form>
    --%>
    下面是显示页面
    <%
    String content = request.getParameter("content");
    out.print(content);
    %>
      

  4.   

    我也想知道这个问题的答案?但7楼的答案好像有所不同 textarea前没有html, 即不是html:textarea标签哦!
      

  5.   

    并且7楼的答案是fckeditor版本!
      

  6.   

    后来我也没弄明白,索性就不加html,也能保存到数据库