Java瑣事

          -I am not alone
          posts - 54, comments - 30, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
              使用fckeditor是能夠上傳文章了,但是,如何才能從數(shù)據(jù)庫中重新讀取信息到fckeditor的編輯區(qū)域里去呢?可能我太愚鈍,網(wǎng)上關(guān)于這方面的解決方法竟然沒有找到。只能去找官方的幫助文檔,但又可能是這個(gè)問題過于簡(jiǎn)單,這方面的幫助信息也沒有找到。接下來唯一的辦法就是實(shí)例源碼,解壓縮下載的FCKeditor-2.3.rar,打開web文件夾下的_sample,sample02.jsp有這么一部分
          <form action="sampleposteddata.jsp" method="get" target="_blank">
                      
          <FCK:editor id="EditorDefault" basePath="/FCKeditor/"
                          imageBrowserURL
          ="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
                          linkBrowserURL
          ="/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
                          flashBrowserURL
          ="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
                          imageUploadURL
          ="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
                          linkUploadURL
          ="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
                          flashUploadURL
          ="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
                          This is some 
          <strong>sample text</strong>. You are using <href="http://www.fredck.com/fckeditor/">FCKeditor</a>.
                      
          </FCK:editor>
                      
          <br>
                      
          <input type="submit" value="Submit">
                  
          </form>
          其中的這一句“This is some <strong>sample text</strong>. You are using <a >FCKeditor</a>”顯示在頁面上就是“This is some sample text.  You are using FCKeditor ”把這個(gè)文件放tomcat中執(zhí)行后,它顯示在了編輯區(qū)里。所以我使用struts2的標(biāo)簽<s:property> 同樣獲取了帶有格式的文章內(nèi)容,但顯示到編輯區(qū)的是帶有< >的標(biāo)簽和文本,所以意識(shí)到<s:property>是直接被顯示的,而不會(huì)經(jīng)過解釋。于是,想到,用java代碼來獲取內(nèi)容,并希望瀏覽器對(duì)其進(jìn)行解釋然后顯示,即把<s:property>所呆的地方換成<%=(String)request.getAttribute("mknr.content") %>。終于可以在編輯區(qū)顯示想要的內(nèi)容了。但這樣又在jsp頁面中寫進(jìn)java代碼了,都是自己所學(xué)不精,哪位仁兄告訴下ognl是否可以代替這句話呢?
          主站蜘蛛池模板: 大邑县| 长春市| 南宫市| 墨竹工卡县| 尼勒克县| 延川县| 阿拉善盟| 蚌埠市| 华容县| 青龙| 城市| 潼关县| 弥勒县| 繁峙县| 宁城县| 临漳县| 龙陵县| 龙川县| 武夷山市| 上饶市| 湾仔区| 洪雅县| 阿巴嘎旗| 龙胜| 冷水江市| 游戏| 镇江市| 霍城县| 淮北市| 柳江县| 永登县| 朔州市| 南平市| 北海市| 汾西县| 五寨县| 石楼县| 北宁市| 游戏| 神木县| 景洪市|