雖然百度ueditor的官網和文檔都已經很詳細了。可是本身仍是記錄下 本身使用uEditor的過程。javascript
這是 他的官網 http://ueditor.baidu.com/website/ 例子 文檔什麼的都很詳細。java

我下的是 開發版中的gbk版(視項目的編碼方式而定)web
下載下來後 解壓 把文件夾拷到你java ee項目的webroot下如圖:app

ueditor裏面的文件夾都沒變 只是jsp文件夾把裏面的
前兩個jar包弄到web-Inf裏面的lib下面。jsp
把Uploader.java 放到src下面如圖編輯器
:
包名和imageUp.jsp fileUp.jsp裏面引用的一致。工具
而後就是在jsp頁面裏面應用了 代碼 以下:oop
- <span style="font-size:14px"><tr>
- <td height="25" align="right" bgcolor="#ecf5ff" style="width: 28%">
- 新聞內容:
- </td>
- <td width="width: 72%" height="25" align="left" bgcolor="#FFFFFF">
-
- <script type="text/plain" id="myEditor" name=content></script>
- <script type="text/javascript">
- var Editor= new UE.ui.Editor({
- initialFrameWidth:'550',
- initialFrameHeight:'300',
- toolbars:[['fullscreen', 'undo', 'redo', '|',
- 'bold', 'italic', 'underline', 'fontborder',</span><span style="font-size:14px"> <span style="font-size:14px">'strike</span>through', 'superscript', 'subscript'</span><span style="font-size:14px">]]
- ,elementPathEnabled : false});
- Editor.render('myEditor');
- </script>
- </td>
- </tr></span>
new UE.ui.Editor 是初始化編輯器的方法 {}裏面是實例化編輯器的一些初始化參數 能夠設置編輯器的寬高 工具欄顯示的工具等。ui
以上的tr 是放在form裏面的 提交到後臺後 用request.getPrameter("content") (name=content name等於啥 就獲取啥參數就能夠了)編碼
修改取初始化值的時候用
script標籤裏面加上 ${}el 表達式取值便可。
提交後臺取值 同上。