<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    無(wú)聊人士

    搬家==》www.soapui.cn

      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      32 隨筆 :: 0 文章 :: 60 評(píng)論 :: 0 Trackbacks

    感謝google,感謝"webwork2.2.2的富文本編輯器的不完美解決方法"一文,感謝李李。當(dāng)然,最應(yīng)該感謝的是開(kāi)源(刨源代碼刨出來(lái)的)。

    1、解決/webwork/*的路徑問(wèn)題
    解決辦法見(jiàn)“http://m.tkk7.com/mmwy/archive/2006/08/18/64234.html
    BTW:也可以象“不完美解決方法”一文中描述的一樣,設(shè)webwork.serve.static=false,將static/下的東西拷至/webwork目錄下。

    2、重寫(xiě)(繼承)DefaultRichtexteditorConnector類,解決無(wú)法在windows平臺(tái)上創(chuàng)建目錄的問(wèn)題

    ?1 public ? class ?RichtexteditorConnector? extends ?DefaultRichtexteditorConnector? {
    ?2 ?? /**
    ?3 ???*?解決無(wú)法在windows平臺(tái)上創(chuàng)建目錄的問(wèn)題
    ?4 ???*?overriding?methods
    ?5 ???*?(non-Javadoc)
    ?6 ???*? @see ?com.opensymphony.webwork.components.DefaultRichtexteditorConnector#calculateActualServerPath(java.lang.String,?java.lang.String,?java.lang.String)
    ?7 ??? */

    ?8 ?? protected ?String?calculateActualServerPath(String?actualServerPath,
    ?9 ??????String?type,?String?folderPath)? throws ?Exception? {
    10 ????String?path? = ?StringUtils.replaceChars( " file:/// "
    11 ???????? + ?servletContext.getRealPath( " / " ? + ?actualServerPath),? ' \\ ' ,? ' / ' );
    12 ????makeDirIfNotExists(path);
    13 ????path? = ?path.endsWith( " / " )
    14 ?????? ? ?path
    15 ??????:?path? + ? " / " ;
    16 ???? return ?path? + ?type? + ?folderPath;
    17 ??}

    18
    19 ?? private ?ServletContext?servletContext;
    20
    21 ?? public ? void ?setServletContext(ServletContext?servletContext)? {
    22 ???? this .servletContext? = ?servletContext;
    23 ??}

    24 }

    3、配置webwork.xml,解決上傳路徑自定義問(wèn)題(actualServerPath參數(shù),默認(rèn)的使用DefaultRichtexteditorConnector類中protected String _actualServerPath = "/com/opensymphony/webwork/static/richtexteditor/data/";的定義),解決獲取上傳文件url路徑問(wèn)題(默認(rèn)的使用AbstractRichtexteditorConnector類中String _serverPath = "/webwork/richtexteditor/data/";的定義)

    ?1 ???? < package
    ?2 ???????? name ="richtexteditor-browse"
    ?3 ????????extends ="webwork-default"
    ?4 ????????namespace ="/webwork/richtexteditor/editor/filemanager/browser/default/connectors/jsp" >
    ?5 ???????? < action
    ?6 ???????????? name ="connector"
    ?7 ????????????class ="com.mmwy.weblogic_sitemesh.util.RichtexteditorConnector"
    ?8 ????????????method ="browse" >
    ?9 ???????????? < result
    10 ???????????????? name ="getFolders"
    11 ????????????????type ="richtexteditorGetFolders" ? />
    12 ???????????? < result
    13 ???????????????? name ="getFoldersAndFiles"
    14 ????????????????type ="richtexteditorGetFoldersAndFiles" ? />
    15 ???????????? < result
    16 ???????????????? name ="createFolder"
    17 ????????????????type ="richtexteditorCreateFolder" ? />
    18 ???????????? < result
    19 ???????????????? name ="fileUpload"
    20 ????????????????type ="richtexteditorFileUpload" ? />
    21 ???????????? < param? name ="actualServerPath" > /upload/ </ param >
    22 ???????????? < param? name ="serverPath" > /upload/ </ param >
    23 ???????? </ action >
    24 ???? </ package >
    25
    26 ???? < package
    27 ???????? name ="richtexteditor-upload"
    28 ????????extends ="webwork-default"
    29 ????????namespace ="/webwork/richtexteditor/editor/filemanager/upload" >
    30 ???????? < action
    31 ???????????? name ="uploader"
    32 ????????????class ="com.mmwy.weblogic_sitemesh.util.RichtexteditorConnector"
    33 ????????????method ="upload" >
    34 ???????????? < result? name ="richtexteditorFileUpload" ? />
    35 ???????????? < param? name ="actualServerPath" > /upload/ </ param >
    36 ???????????? < param? name ="serverPath" > /upload/ </ param >
    37 ???????? </ action >
    38 ???? </ package >

    注意:serverPath路徑必須有后面的"/"。

    4、解決獲取上傳文件url只能使用80端口的問(wèn)題
    順著源碼一直跟進(jìn),首先是DefaultRichtexteditorConnector類:

    1 ???? protected ?String?calculateServerPath(String?serverPath,?String?folderPath,?String?type)? throws ?Exception? {
    2 ???????? // return?UrlHelper.buildUrl(serverPath,?_request,?_response,?null,?_request.getScheme(),?true,?true,?true);
    3 ???????? return ?UrlHelper.buildUrl(serverPath + type + folderPath,?_request,?_response,? new ?HashMap(),?_request.getScheme(),? true ,? true ,? true );
    4 ????}

    再跟進(jìn)UrlHelper.buildUrl方法

    ?1 ???? public ? static ?String?buildUrl(String?action,?HttpServletRequest?request,?HttpServletResponse?response,?Map?params,?String?scheme,? boolean ?includeContext,? boolean ?encodeResult,? boolean ?forceAddSchemeHostAndPort)? {
    ?2 ????????StringBuffer?link? = ? new ?StringBuffer();
    ?3
    ?4 ???????? boolean ?changedScheme? = ? false ;
    ?5
    ?6 ???????? int ?httpPort? = ?DEFAULT_HTTP_PORT;
    ?7
    ?8 ???????? try ? {
    ?9 ????????????httpPort? = ?Integer.parseInt((String)?Configuration.get(WebWorkConstants.WEBWORK_URL_HTTP_PORT));
    10 ????????}
    ? catch ?(Exception?ex)? {
    11 ????????}

    12
    13 ???????? int ?httpsPort? = ?DEFAULT_HTTPS_PORT;
    14
    15 ???????? try ? {
    16 ????????????httpsPort? = ?Integer.parseInt((String)?Configuration.get(WebWorkConstants.WEBWORK_URL_HTTPS_PORT));
    17 ????????}
    ? catch ?(Exception?ex)? {
    18 ????????}

    19

    因此,解決這個(gè)問(wèn)題的方法很簡(jiǎn)單,只要在webwork.properties中設(shè)webwork.url.http.port = 8080即可。

    5、語(yǔ)言問(wèn)題
    RichTextEditor標(biāo)記autoDetectLanguage默認(rèn)值為true,在中文環(huán)境下使用/editor/lang/zh.js,顯示繁體中文字符,而簡(jiǎn)體中文應(yīng)該使用zh-cn.js,因此,應(yīng)設(shè)置defaultLanguage="zh-cn"。

    1 ???????????? < @ww .richtexteditor
    2 ????????????????theme ="simple"
    3 ????????????????defaultLanguage ="zh-cn"
    4 ????????????????width ="750"
    5 ????????????????height ="500"
    6 ????????????????name ="description4" ? />

    ?



    ?

    posted on 2006-09-11 12:29 mmwy 閱讀(2275) 評(píng)論(0)  編輯  收藏 所屬分類: WebWork、Struts2、FreeMarker
    主站蜘蛛池模板: 亚洲精品日韩专区silk| 国产亚洲人成网站观看| 国产亚洲精品成人AA片| 亚洲性线免费观看视频成熟| 亚洲性天天干天天摸| a级毛片毛片免费观看久潮| 亚洲乱码中文字幕久久孕妇黑人| 久久久久久国产a免费观看不卡| 久久久亚洲精品蜜桃臀| 久久久久久噜噜精品免费直播| 亚洲人成网7777777国产| 四虎成人精品永久免费AV| 777亚洲精品乱码久久久久久 | 日韩中文无码有码免费视频| 亚洲色偷偷综合亚洲AV伊人蜜桃 | 69堂人成无码免费视频果冻传媒 | jlzzjlzz亚洲jzjzjz| 毛片免费vip会员在线看| 国产精品亚洲小说专区| 亚洲一区二区视频在线观看| a级毛片毛片免费观看永久| 亚洲精品国产情侣av在线| 国产又黄又爽又猛免费app| 欧美日韩亚洲精品| 亚洲欧洲自拍拍偷午夜色无码| 久久一本岛在免费线观看2020| 亚洲视屏在线观看| 日韩视频免费在线| 国产在线观看xxxx免费| 亚洲国产成人久久综合一区| 国产午夜免费福利红片| 三级黄色片免费看| www.亚洲成在线| 亚洲一区无码精品色| 亚洲免费在线视频观看| 国产精品亚洲专区一区| 亚洲AV无码久久精品蜜桃| 最近2019中文免费字幕| 久久国产乱子伦精品免费午夜| 精品亚洲AV无码一区二区三区| 久久激情亚洲精品无码?V|