ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品美女,久久99久久精品国产,国产精品视频男人的天堂http://www.aygfsteel.com/quaff/飞蛾扑ç«zh-cnSun, 18 May 2025 01:40:15 GMTSun, 18 May 2025 01:40:15 GMT60如何应对xssæ”Õd‡»?http://www.aygfsteel.com/quaff/archive/2007/09/24/147744.htmlquaffquaffMon, 24 Sep 2007 03:33:00 GMThttp://www.aygfsteel.com/quaff/archive/2007/09/24/147744.htmlhttp://www.aygfsteel.com/quaff/comments/147744.htmlhttp://www.aygfsteel.com/quaff/archive/2007/09/24/147744.html#Feedback7http://www.aygfsteel.com/quaff/comments/commentRss/147744.htmlhttp://www.aygfsteel.com/quaff/services/trackbacks/147744.html è¯?a href="http://www.aygfsteel.com/quaff/archive/2005/12/08/23030.html">点击˜q™é‡Œ

怎么样é¿å…xssæ”Õd‡»?
使用jsp tagæ¥è¾“å‡?比如<c:out/><s:property/>,˜q™äº›tag默认都对html代ç è½¬ä¹‰äº?br />
但是åˆå¼•入了一个新的难é¢?怎么使用富文本编辑器?
富文本编辑器最¾lˆå¾—到的内容是html代ç ,òq¶ä¸”è¦åŽŸæ ¯‚¾“å‡?但是htmlä»£ç æ˜¯å¯ä»¥ç›´æŽ¥æˆ–者间接编辑的,˜q™æ ·çš„诞®±å¯ä»¥æ’å…¥ä“Q何代ç ?å¯ä»¥ç”?lt;script>标签,å¯ä»¥ç”?lt;a href="javascript:xxx">,å¯ä»¥ç”¨css里é¢çš„expression,<img onload="xxx">½{‰ç­‰.

解决æ–ÒŽ³•有两ä¸?br /> 1.在æœåŠ¡å™¨ç«¯è¿‡æ»¤è¿™äº›script,很难全部˜q‡æ×o,ä¸çŸ¥é“有没有现æˆçš„libå¯ä»¥ç”?br /> 2.òq²è„†ä¸ä‹Éç”?åƒå¤§éƒ¨åˆ†è®ºå›é‚£æ ·æžå‡ ä¸ªå®šä¹‰å¥½çš„tag,比如[a][/a]æ’å…¥­‘…链æŽ?˜q™æ ·ä¸å¤Ÿç‰|´»ä¹Ÿåšä¸åˆ°æ‰€è§å³æ‰€å¾?但是安全½W¬ä¸€

ä¸çŸ¥é“大家有什么好的解å†Ïx–¹æ³?



quaff 2007-09-24 11:33 å‘表评论
]]>
一¿Uæ–°çš„hibernateå’Œspring¾l“åˆæ–¹å¼http://www.aygfsteel.com/quaff/archive/2006/04/10/40324.htmlquaffquaffMon, 10 Apr 2006 13:03:00 GMThttp://www.aygfsteel.com/quaff/archive/2006/04/10/40324.htmlhttp://www.aygfsteel.com/quaff/comments/40324.htmlhttp://www.aygfsteel.com/quaff/archive/2006/04/10/40324.html#Feedback1http://www.aygfsteel.com/quaff/comments/commentRss/40324.htmlhttp://www.aygfsteel.com/quaff/services/trackbacks/40324.html内容½‹‡å¹…较长,è¯ïL‚¹å‡?a href="/quaff/articles/40322.html">˜q™é‡Œé˜…读全文ã€?/h4>

quaff 2006-04-10 21:03 å‘表评论
]]>
webwork2.2.2的富文本¾~–辑器的ä¸å®Œ¾ŸŽè§£å†Ïx–¹æ³?/title><link>http://www.aygfsteel.com/quaff/archive/2006/03/26/37485.html</link><dc:creator>quaff</dc:creator><author>quaff</author><pubDate>Sun, 26 Mar 2006 08:41:00 GMT</pubDate><guid>http://www.aygfsteel.com/quaff/archive/2006/03/26/37485.html</guid><wfw:comment>http://www.aygfsteel.com/quaff/comments/37485.html</wfw:comment><comments>http://www.aygfsteel.com/quaff/archive/2006/03/26/37485.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/quaff/comments/commentRss/37485.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/quaff/services/trackbacks/37485.html</trackback:ping><description><![CDATA[先说怎么å?å†ç¨å¾®è§£é‡Šä¸€ä¸‹äؓ什么这么åš<br />1.webwork.properties里é¢è®„¡½®<br />webwork.serve.static=false<br />webwork.multipart.parser=cos<br />2.在webapp的根目录下å¾ä¸€ä¸ªæ–‡ä»¶å¤¹webwork,把webwork.jar里é¢çš?com/opensymphony/webwork/staticå’?template里é¢çš„æ–‡ä»¶å’Œå¤åˆ¶åˆ°è‡ªå·±å¾çš„webworkæ–‡äšg多w‡Œé?åœ?webwork/richtexteditor里é¢å»ºæ–‡ä»¶å¤¹data(å¯èƒ½ä¼šè‡ªåЍå¾,没测试过)<br />3.写一个RichtexteditorConnector<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">package</span><span style="color: rgb(0, 0, 0);"> test;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.FileFilter;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.IOException;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.ArrayList;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.List;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.servlet.ServletContext;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.apache.commons.logging.Log;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.apache.commons.logging.LogFactory;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> com.opensymphony.webwork.components.DefaultRichtexteditorConnector;<br /><br /><br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> RichtexteditorConnector </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> DefaultRichtexteditorConnector {<br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">final</span><span style="color: rgb(0, 0, 0);"> Log _log </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> LogFactory<br />            .getLog(RichtexteditorConnector.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br /><br />    </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> ServletContext servletContext;<br /><br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setServletContext(ServletContext servletContext) {<br />        </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.servletContext </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> servletContext;<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> String calculateActualServerPath(String actualServerPath,<br />            String type, String folderPath) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        String path </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> servletContext.getRealPath(actualServerPath);<br />        path </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> path.replace(</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">\\</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">);<br />        makeDirIfNotExists(path);<br />        path </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> path.endsWith(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);"> path : path </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> path </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> type </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> folderPath;<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> Folder[] getFolders(String virtualFolderPath, String type)<br />            </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        String path </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> calculateActualServerPath(getActualServerPath(), type,<br />                virtualFolderPath);<br />        makeDirIfNotExists(path);<br />        java.io.File f </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> java.io.File(path);<br />        java.io.File[] children </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> f.listFiles(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> FileFilter() {<br />            </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> accept(java.io.File pathname) {<br />                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">pathname.isFile()) {<br />                    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br />                }<br />                </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br />            }<br />        });<br /><br />        List tmpFolders </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ArrayList();<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> a </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; a </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> children.length; a</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br />            tmpFolders.add(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Folder(children[a].getName()));<br />        }<br /><br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> (Folder[]) tmpFolders.toArray(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Folder[</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">]);<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> FoldersAndFiles getFoldersAndFiles(String virtualFolderPath,<br />            String type) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        String path </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> calculateActualServerPath(getActualServerPath(), type,<br />                virtualFolderPath);<br />        makeDirIfNotExists(path);<br />        java.io.File f </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> java.io.File(path);<br />        java.io.File[] children </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> f.listFiles();<br /><br />        List directories </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ArrayList();<br />        List files </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ArrayList();<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> a </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; a </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> children.length; a</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (children[a].isDirectory()) {<br />                directories.add(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Folder(children[a].getName()));<br />            } </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> {<br />                </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                    files.add(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> File(children[a].getName(),<br />                            fileSizeInKBytes(children[a])));<br />                } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />                    _log.error(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">cannot deal with file </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> children[a], e);<br />                }<br />            }<br />        }<br /><br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> FoldersAndFiles((Folder[]) directories<br />                .toArray(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Folder[</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">]), (File[]) files.toArray(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> File[</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">]));<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> FileUploadResult fileUpload(String virtualFolderPath,<br />            String type, String filename, String contentType,<br />            java.io.File newFile) {<br />        </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />            String tmpDir </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> calculateActualServerPath(getActualServerPath(),<br />                    type, virtualFolderPath);<br />            makeDirIfNotExists(tmpDir);<br />            String tmpFile </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> tmpDir </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> filename;<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (makeFileIfNotExists(tmpFile)) {<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> already exists</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> a </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />                String ext </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> String.valueOf(a);<br />                tmpFile </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> calculateActualServerPath(getActualServerPath(),<br />                        type, virtualFolderPath)<br />                        </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> filename </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ext;<br />                </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);"> (makeFileIfNotExists(tmpFile)) {<br />                    a </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> a </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />                    ext </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> String.valueOf(a);<br />                    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (a </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);">) {<br />                        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> FileUploadResult.invalidFile();<br />                    }<br />                }<br />                copyFile(newFile, </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> java.io.File(tmpFile));<br />                </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> FileUploadResult<br />                        .uploadCompleteWithFilenamChanged(filename </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ext);<br />            } </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> {<br />                copyFile(newFile, </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> java.io.File(tmpFile));<br />                </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> FileUploadResult.uploadComplete();<br />            }<br />        } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            _log.error(e.toString(), e);<br />            e.printStackTrace();<br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> FileUploadResult.invalidFile();<br />        }<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> unknownCommand(String command, String virtualFolderPath,<br />            String type, String filename, String contentType,<br />            java.io.File newFile) {<br />        </span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> RuntimeException(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">unknown command </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> command);<br />    }<br /><br />    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />     * <br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> path<br />     * </span><span style="color: rgb(128, 128, 128);">@return</span><span style="color: rgb(0, 128, 0);"> true if file already exists, false otherwise.<br />     </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> makeDirIfNotExists(String path) {<br />        java.io.File dir </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> java.io.File(path);<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">dir.exists()) {<br />            _log.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">make directory </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> dir);<br />            </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> ok </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> dir.mkdirs();<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">ok) {<br />                </span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> RuntimeException(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">cannot make directory </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> dir);<br />            }<br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br />        }<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> makeFileIfNotExists(String filePath) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> IOException {<br />        java.io.File f </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> java.io.File(filePath);<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">f.exists()) {<br />            _log.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">creating file </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> filePath);<br />            </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> ok </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> f.createNewFile();<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">ok) {<br />                </span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> RuntimeException(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">cannot create file </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> filePath);<br />            }<br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br />        }<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br />    }<br /><br />}</span></div>4.xwork.xml加上<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">package </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="richtexteditor-browse"</span><span style="color: rgb(255, 0, 0);"> extends</span><span style="color: rgb(0, 0, 255);">="webwork-default"</span><span style="color: rgb(255, 0, 0);"><br />        namespace</span><span style="color: rgb(0, 0, 255);">="/webwork/richtexteditor/editor/filemanager/browser/default/connectors/jsp"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">action </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="connector"</span><span style="color: rgb(255, 0, 0);"><br />            class</span><span style="color: rgb(0, 0, 255);">="test.RichtexteditorConnector"</span><span style="color: rgb(255, 0, 0);"><br />            method</span><span style="color: rgb(0, 0, 255);">="browse"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="actualServerPath"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                /webwork/richtexteditor/data<br />            </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="getFolders"</span><span style="color: rgb(255, 0, 0);"> type</span><span style="color: rgb(0, 0, 255);">="richtexteditorGetFolders"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="getFoldersAndFiles"</span><span style="color: rgb(255, 0, 0);"><br />                type</span><span style="color: rgb(0, 0, 255);">="richtexteditorGetFoldersAndFiles"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="createFolder"</span><span style="color: rgb(255, 0, 0);"><br />                type</span><span style="color: rgb(0, 0, 255);">="richtexteditorCreateFolder"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="fileUpload"</span><span style="color: rgb(255, 0, 0);"> type</span><span style="color: rgb(0, 0, 255);">="richtexteditorFileUpload"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">action</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">package</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">package </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="richtexteditor-upload"</span><span style="color: rgb(255, 0, 0);"> extends</span><span style="color: rgb(0, 0, 255);">="webwork-default"</span><span style="color: rgb(255, 0, 0);"><br />        namespace</span><span style="color: rgb(0, 0, 255);">="/webwork/richtexteditor/editor/filemanager/upload"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">action </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="uploader"</span><span style="color: rgb(255, 0, 0);"><br />            class</span><span style="color: rgb(0, 0, 255);">="test.RichtexteditorConnector"</span><span style="color: rgb(255, 0, 0);"><br />            method</span><span style="color: rgb(0, 0, 255);">="upload"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="actualServerPath"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                /webwork/richtexteditor/data<br />            </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="richtexteditorFileUpload"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">action</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">package</span><span style="color: rgb(0, 0, 255);">></span></div>5.é…置标签<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);"><ww:form action="test" method="post"><br />    <%request.setAttribute("contextPath",request.getContextPath());%><br />    <ww:richtexteditor basePath="%{#request.contextPath}/webwork/richtexteditor/"         toolbarCanCollapse="false" width="700" label="description" name="content" defaultLanguage="zh-cn" /><br />    <ww:submit value="submit" /><br /></ww:form></span><span style="color: rgb(0, 0, 255);"></span></div>6.æœåŠ¡å™¨ç«¯å£è®¾¾|®äØ“80<br /><br />原因<br />1.<br />webwork.serve.static=false<br />/webwork/*˜q™æ ·çš„URL是å¯ä»¥ç›´æŽ¥è®¿é—®ä¸éœ€è¦é€šè¿‡webwork,˜q™æ ·åšæ˜¯ä¸ÞZº†è‡ªå·±å¯ä»¥åœ¨é‡Œé¢å¾æ–‡äšg,òq¶ä¸”å¯ä»¥æ–¹ä¾¿çš„访问这些文ä»?br />webwork.multipart.parser=cos<br />讄¡½®ä¸ºjakarta上传文äšg䏿ˆåŠ?com.opensymphony.webwork.interceptor.FileUploadInterceptorè§£æžMultiPartRequestWrapper䏿ˆåŠ?åŽŸå› ä¸æ¸…æ¥?åæ­£ç”¨cosž®±å¯ä»¥äº†,记得加上cos.jar<br />2.å› äØ“è®„¡½®äº†webwork.serve.static=false需è¦è¿™æ ·åš<br />3.覆盖webworkçš„DefaultRichtexteditorConnector,最关键的是覆盖calculateActualServerPath()æ–ÒŽ³•,默认是把文äšg攑ֈ°/WEB-INF/classes/com/opensymphony/webwork/static/richtexteditor/data/,æˆ‘ä»¬éœ€è¦æ”¾åˆ?webwork/richtexteditor/data/里é¢,覆盖其他æ–ÒŽ³•是因为默认对文äšg的访问都是通过<br />new File(new URI("file://"+filePath);æ¥è®¿é—®çš„,会有些问é¢?直接new File(filePath)ž®±å¯ä»¥äº†<br />4.使用自己的RichtexteditorConnector,òq¶ä¸”讄¡½®å‚æ•°actualServerPath,其他傿•°ä¸è¦æ”?webwork默认的是˜q™æ ·<br />5.basePath必须自己指定ä¸èƒ½ç”¨é»˜è®¤çš„,虽然指定的值和默认的是一æ ?但是ä¸è‡ªå·±æŒ‡å®šçš„è¯å®ƒè‡ªåŠ¨åŠ ä¸Šjsessionid,å¦?webwork/richtexteditor/;jsessionid=301gs94034pki/editor/fckeditor.html,å› äØ“è®„¡½®äº†webwork.serve.static=false,所以æœåС噍ä¸èƒ½è§£æž˜q™ä¸ªurl<br />defaultLanguage="zh-cn",䏿Œ‡å®šçš„è¯ä¸­æ–‡é»˜è®¤æ˜¯¾J体<br />6.æœåŠ¡å™¨ç«¯å£å¿…™åÖMØ“80ä¸èƒ½ä¸?080,因䨓fckeditor链接你上传的文äšg的时å€?ä¸ä¼šæŠŠç«¯å£åŠ ä¸ŠåŽ»<br /><img src ="http://www.aygfsteel.com/quaff/aggbug/37485.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/quaff/" target="_blank">quaff</a> 2006-03-26 16:41 <a href="http://www.aygfsteel.com/quaff/archive/2006/03/26/37485.html#Feedback" target="_blank" style="text-decoration:none;">å‘表评论</a></div>]]></description></item><item><title>webwork2.2.2里é¢çš„富文本¾~–辑器存在的一些问é¢?/title><link>http://www.aygfsteel.com/quaff/archive/2006/03/24/37259.html</link><dc:creator>quaff</dc:creator><author>quaff</author><pubDate>Fri, 24 Mar 2006 11:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/quaff/archive/2006/03/24/37259.html</guid><wfw:comment>http://www.aygfsteel.com/quaff/comments/37259.html</wfw:comment><comments>http://www.aygfsteel.com/quaff/archive/2006/03/24/37259.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/quaff/comments/commentRss/37259.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/quaff/services/trackbacks/37259.html</trackback:ping><description><![CDATA[webwork2.2.2内置了fckeditoråQŒç”¨æ³?br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">ww:richtexteditor </span><span style="COLOR: #ff0000">toolbarCanCollapse</span><span style="COLOR: #0000ff">="false"</span><span style="COLOR: #ff0000"> width</span><span style="COLOR: #0000ff">="700"</span><span style="COLOR: #ff0000"> label</span><span style="COLOR: #0000ff">="æè¿°"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="description"</span><span style="COLOR: #0000ff">/></span></div>xwork.xml加入åQ?br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">package </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="richtexteditor-browse"</span><span style="COLOR: #ff0000"> extends</span><span style="COLOR: #0000ff">="webwork-default"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        namespace</span><span style="COLOR: #0000ff">="/webwork/richtexteditor/editor/filemanager/browser/default/connectors/jsp"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">action </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="connector"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            class</span><span style="COLOR: #0000ff">="com.opensymphony.webwork.components.DefaultRichtexteditorConnector"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            method</span><span style="COLOR: #0000ff">="browse"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">result </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="getFolders"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="richtexteditorGetFolders"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">result </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="getFoldersAndFiles"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />                type</span><span style="COLOR: #0000ff">="richtexteditorGetFoldersAndFiles"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">result </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="createFolder"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="richtexteditorCreateFolder"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">result </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="fileUpload"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="richtexteditorFileUpload"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">action</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">package</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">package </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="richtexteditor-upload"</span><span style="COLOR: #ff0000"> extends</span><span style="COLOR: #0000ff">="webwork-default"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        namespace</span><span style="COLOR: #0000ff">="/webwork/richtexteditor/editor/filemanager/upload"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">action </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="uploader"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            class</span><span style="COLOR: #0000ff">="com.opensymphony.webwork.components.DefaultRichtexteditorConnector"</span><span style="COLOR: #ff0000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            method</span><span style="COLOR: #0000ff">="upload"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">result </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="richtexteditorFileUpload"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">action</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">package</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span></div><p><br /><br />存在如下问题:</p><p>1.中文环境默认是ç¹ä½?需è¦åŽ»åŒ…é‡Œé¢ç”¨zh-cn.js替æ¢zh.js<br />2.String path = "file://"+servletContext.getRealPath("/WEB-INF/classes"+actualServerPath),windowsæ–‡äšg路径是\,webwork没有转义或者把\æ›¿æ¢æˆ?,å¯ÒŽ–‡ä»¶çš„讉K—®éƒ½æ˜¯é€šè¿‡new File(new URI(filePath))æ¥è®¿é—?在我机å­ä¸Šä¼šå‡ÞZ¾‹å¤?br />com.opensymphony.webwork.dispatcher.DispatcherUtils - Could not execute action<br />java.lang.IllegalArgumentException: URI has an authority component<br /> at java.io.File.<init>(File.java:326)<br /> at com.opensymphony.webwork.components.DefaultRichtexteditorConnector.makeDirIfNotExists(DefaultRichtexteditorConnector.java:171)</p><p>解决æ–ÒŽ³•是自己写一个类¾l§æ‰¿com.opensymphony.webwork.components.DefaultRichtexteditorConnectorç„¶åŽè¦†ç›–它的æ–ÒŽ³•</p><p>3.æ–‡äšg囄¡‰‡é»˜è®¤æ˜¯ä¿å­˜åœ¨\WEB-INF\classes\com\opensymphony\webwork\static\richtexteditor\data里é¢,写入和读å–都存在问题,写入的时候如果context是reloadable="true"则会引å‘contextçš„reload,在contextèµäh¥ä¹‹åŽæ–°åŠ çš„æ–‡ä»¶æ¯”å¦‚test.jpgä¸èƒ½é€šè¿‡urlæ¥è®¿é—?webwork/data/test.jpg,˜q™ä¸ªåº”该是classloaderä¸ä¼šåœ¨contextå¯åЍ之åŽåŠ è²˜q™äº›æ–‡äšg</p><p>4.上传的表å•é‡Œé¢æ²¡æœ‰action,虽然tag里é¢é»˜è®¤æ˜?br />imageUploadURL="/webwork/richtexteditor/editor/filemanager/upload/uploader.action?Type=Image" <br />flashUploadURL="/webwork/richtexteditor/editor/filemanager/upload/uploader.action?Type=Flash"<br />linkUploadURL="/webwork/richtexteditor/editor/filemanager/upload/uploader.action?Type=File"<br />wikidocs里é¢è¯´æ˜¯"/webwork/static/richtexteditor/editor/filemanager/upload/uploader.action?Type=File"应该是多了个/static<br />但是实际上上传的form里é¢çš„action是空çš?上传ä¸äº†ä¸œè¥¿,˜q™ä¸ªå¯èƒ½éœ€è¦åŽ»æ”¹fckeditor<br /></p><img src ="http://www.aygfsteel.com/quaff/aggbug/37259.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/quaff/" target="_blank">quaff</a> 2006-03-24 19:07 <a href="http://www.aygfsteel.com/quaff/archive/2006/03/24/37259.html#Feedback" target="_blank" style="text-decoration:none;">å‘表评论</a></div>]]></description></item><item><title>用jarkataçš„commons-VFS监视文äšg夹的å˜åŒ–http://www.aygfsteel.com/quaff/archive/2006/03/02/33229.htmlquaffquaffThu, 02 Mar 2006 07:48:00 GMThttp://www.aygfsteel.com/quaff/archive/2006/03/02/33229.htmlhttp://www.aygfsteel.com/quaff/comments/33229.htmlhttp://www.aygfsteel.com/quaff/archive/2006/03/02/33229.html#Feedback6http://www.aygfsteel.com/quaff/comments/commentRss/33229.htmlhttp://www.aygfsteel.com/quaff/services/trackbacks/33229.htmlFileSystemManager fsManager = null
FileObject listendir 
= null
try { 
fsManager 
= VFS.getManager(); 
listendir 
= fsManager.resolveFile(new File( 
"./classes/").getAbsolutePath()); 
catch (FileSystemException e) { 
log.error(
"监视文äšg夹出错了", e); 
e.printStackTrace(); 

DefaultFileMonitor fm 
= new DefaultFileMonitor(new FileListener() { 
public void fileCreated(FileChangeEvent event) throws Exception { 
monitor(event); 


public void fileDeleted(FileChangeEvent event) throws Exception { 
monitor(event); 


public void fileChanged(FileChangeEvent event) throws Exception { 
monitor(event); 


private void monitor(FileChangeEvent event) { 
FileObject fileObject 
= event.getFile(); 
FileName fileName 
= fileObject.getName(); 
if (fileName.getBaseName().endsWith(".class")) { 
reload(); 


}); 
fm.setRecursive(
true); 
fm.addFile(listendir); 
fm.start();



quaff 2006-03-02 15:48 å‘表评论
]]>
写的一个简å•的代ç ç”Ÿæˆå™?/title><link>http://www.aygfsteel.com/quaff/archive/2006/02/11/30254.html</link><dc:creator>quaff</dc:creator><author>quaff</author><pubDate>Sat, 11 Feb 2006 04:31:00 GMT</pubDate><guid>http://www.aygfsteel.com/quaff/archive/2006/02/11/30254.html</guid><wfw:comment>http://www.aygfsteel.com/quaff/comments/30254.html</wfw:comment><comments>http://www.aygfsteel.com/quaff/archive/2006/02/11/30254.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.aygfsteel.com/quaff/comments/commentRss/30254.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/quaff/services/trackbacks/30254.html</trackback:ping><description><![CDATA[<A HREF="/Files/quaff/MyCodeGen-0.6.zip">下è²</A><BR><BR>用户åªéœ€è¦å†™models.xml,具体傿•°å‚ç…§models.dtd,执行 <BR>java -cp .;freemarker.jar org.mycodegen.Main models.xml <P></P> <P>生æˆçš„代ç åŒ…æ‹?BR>1.POJO¾c?¾cÈš„hibernate映射文äšg,DAO¾c?Manager¾c?spring的对hibernatež®è£…的酾|®æ–‡ä»?如果你ä¸ä½¿ç”¨webwork,åªéœ€è¦è¿™äº›å°±è¡Œäº†<BR>2.webworkçš„Action¾c?Actionçš„èµ„æºæ–‡ä»?Action的校验文ä»?xwork.xml,<BR>  æ¨¡æ¿æ”¯æŒfreemarkerå’Œjsp两ç§,默认是jsp,列表功能(å¯ä»¥åˆ†é¡µ),删除功能,录入功能,查看功能,查询功能(查询æ¡äšg自己å†?</P> <P>生æˆä¹‹åŽåŠ ä¸Šä¾èµ–的包ž®±å¯ä»¥è¿è¡Œäº†,剩下的问题就是根æ®ä¸šåŠ¡é€»è¾‘æ¥ä¿®æ”¹ç•Œé¢å’ŒAction½{?/P><img src ="http://www.aygfsteel.com/quaff/aggbug/30254.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/quaff/" target="_blank">quaff</a> 2006-02-11 12:31 <a href="http://www.aygfsteel.com/quaff/archive/2006/02/11/30254.html#Feedback" target="_blank" style="text-decoration:none;">å‘表评论</a></div>]]></description></item><item><title>Hello,Worldhttp://www.aygfsteel.com/quaff/archive/2005/12/08/23030.htmlquaffquaffThu, 08 Dec 2005 12:50:00 GMThttp://www.aygfsteel.com/quaff/archive/2005/12/08/23030.htmlhttp://www.aygfsteel.com/quaff/comments/23030.htmlhttp://www.aygfsteel.com/quaff/archive/2005/12/08/23030.html#Feedback7http://www.aygfsteel.com/quaff/comments/commentRss/23030.htmlhttp://www.aygfsteel.com/quaff/services/trackbacks/23030.htmlalert('xss')

quaff 2005-12-08 20:50 å‘表评论
]]>
Ö÷Õ¾Ö©Öë³ØÄ£°å£º ÁêË®| ¸»´¨| ƽ¶¨ÏØ| ÄϲýÊÐ| Âò³µ| ÑÓ±ß| ÍþÄþ| ÐÂÓªÊÐ| Ò˾ýÏØ| »Ȱ| Ì«²ÖÊÐ| ʯÊ×ÊÐ| ÄÛ½­ÏØ| ¹§³Ç| ÈÊÊÙÏØ| ѰÎÚÏØ| ǰ¹ù¶û| ½ºÖÝÊÐ| ½­ÓÍÊÐ| å¡ÏªÏØ| ±ö´¨ÏØ| ƽºÍÏØ| ¹±¸ÂÏØ| ·áÕòÊÐ| ÂÞÉ½ÏØ| »·áÏØ| ÁÙ³ÇÏØ| ÏóÉ½ÏØ| ¶õ¶û¶à˹ÊÐ| µ±ÐÛÏØ| ¹ȪÊÐ| ÈôÇ¼ÏØ| ÒÁÄþÏØ| Ãñ·áÏØ| ¸ßÌ¨ÏØ| ÍûÚÓÏØ| ÆîÃÅÏØ| ̨ÖÐÏØ| ÐÂÒ°ÏØ| ÌÁ¹ÁÇø| µç°×ÏØ|