window.UEDITOR_HOME_URL="${jspPath}/js/editor/";//指向根目錄初始化對象4.

日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

ueditor 富文本編輯器的 初體驗(yàn) java

系統(tǒng) 2471 0

1. http://ueditor.baidu.com/website/index.html ? 下載包

2.解壓然后放入自己項(xiàng)目目錄

ueditor 富文本編輯器的 初體驗(yàn) java

?

?

?3.

<script type="text/javascript">
???window.UEDITOR_HOME_URL="${jspPath}/js/editor/";? //指向根目錄 初始化對象

</script>

?

?4.

<script type="text/javascript" src="${jspPath}/js/editor/editor_all.js"></script>
<script type="text/javascript" src="${jspPath}/js/editor/editor_config.js"></script>
<link rel="stylesheet" href="${jspPath}/js/editor/themes/default/css/ueditor.css">

?

?

<textarea id="summarys"?? rows="15" cols="120" name="summarys" onclick="testedior('summarys')">${summary}</textarea>

?

<script type="text/javascript">
?function testedior(id){
??new UE.ui.Editor({
???toolbars:[['fullscreen', 'source', '|', 'undo', 'redo', '|',
???????????????? 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch','autotypeset','blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist','selectall', 'cleardoc', '|',
???????????????? ,'lineheight','|', 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|','indent', '|',
???????????????? 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|','touppercase','tolowercase','|',
???????????????? 'link', 'unlink', 'anchor', '|','imagecenter', '|','insertimage','pagebreak', '|',
???????????????? 'horizontal', 'date', 'time', 'spechars', '|','inserttable', 'deletetable', '|', 'preview','help']],
???????? initialFrameWidth:950,//寬度
???????? theme:"default", //皮膚
???autoFloatEnabled:false,//工具欄不隨著瀏覽器的滾動(dòng)漂浮
???????? autoHeightEnabled:false,//內(nèi)容不自動(dòng)增高
???????? lang:'zh-cn' //語言
???? }).render(id);
?}
</script>

?5.

上傳圖片需要修改配置editor_config.js

里面的路徑

?//圖片上傳配置區(qū)
??????? ,imageUrl:URL+"file!bdupload.action?_charset_=utf-8"???????????? //圖片上傳提交地址
??????? ,imagePath:""???????????????????? //返回是網(wǎng)絡(luò)地址直接為空

??????? ,imageFieldName:"filedata"?????????????????? //圖片數(shù)據(jù)的key,若此處修改,需要在后臺(tái)對應(yīng)文件修改對應(yīng)參數(shù)
??????? //,compressSide:0??????????????????????????? //等比壓縮的基準(zhǔn),確定maxImageSideLength參數(shù)的參照對象。0為按照最長邊,1為按照寬度,2為按照高度
??????? //,maxImageSideLength:900??????????????????? //上傳圖片最大允許的邊長,超過會(huì)自動(dòng)等比縮放,不縮放就設(shè)置一個(gè)比較大的值,更多設(shè)置在image.html中

?

?

java

?/**
? * 新編輯器
? * @return
? * @throws Exception
? */
?public String bdupload() throws Exception{
??admin=(Admin)ServletActionContext.getRequest().getSession().getAttribute("admin");
??ServletActionContext.getResponse().setContentType("text/html; charset=utf-8");
??? String path1="";
??? int nid=admin.getAdid();
??? if(filedata!=null){
???? path1 = fileService.newuploadPicture(filedata, filedataFileName, new int[] {550, 150},15,nid);
???}
??? String json="{\"title\":\"tt\",\"state\":\"SUCCESS\",\"url\":\""+path1+"\"}";?
???try {
????ServletActionContext.getResponse().getWriter().write(json);
???} catch (IOException e) {
????e.printStackTrace();
???}
??? return null;
? }


??????????

ueditor 富文本編輯器的 初體驗(yàn) java


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!??!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 青阳县| 定襄县| 洛川县| 莎车县| 平南县| 嘉禾县| 新郑市| 黑龙江省| 兴山县| 宣城市| 若羌县| 西华县| 中卫市| 新龙县| 同江市| 大新县| 晋州市| 日照市| 乌鲁木齐县| 广水市| 景泰县| 东阿县| 商城县| 云浮市| 德钦县| 韩城市| 磴口县| 宣化县| 石台县| 兰西县| 饶阳县| 曲周县| 阿勒泰市| 麻阳| 吉木萨尔县| 湖南省| 灌南县| 新和县| 合江县| 崇义县| 游戏|