小弟目前使用3.0的Ckeditor+2.0的Ckfinder整合JSP 
目前的问题是,如果项目放在ROOT下(就是lolcalhost:8080直接访问)一点问题没有。
如果使用项目目录(就是webApp下的project目录下访问用localhost:8080/project)
无法访问服务器
浏览服务器不可用 点进去就是404。上传也无法上传 下面是config.js和config.xml
CKEDITOR.editorConfig = function(config) {
config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html'
config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?type=Images'
config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?type=Flash'
config.filebrowserUploadUrl = '/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Files'
config.filebrowserImageUploadUrl = '/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Images'
config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Flash'
config.filebrowserWindowWidth = '1000';
config.filebrowserWindowHeight = '700';
config.language = "zh-cn";
config.toolbar_Full =
[
    { name: 'document',    items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] },
    { name: 'clipboard',   items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
    { name: 'editing',     items : [ 'Find','Replace','-','SelectAll', 'ImageButton'  ] },
    { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
    '/',
    { name: 'paragraph',   items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
    { name: 'links',       items : [ 'Link','Unlink','Anchor' ] },
    { name: 'insert',      items : [ 'Image','Flash','Table','HorizontalRule','SpecialChar','PageBreak' ] },
    '/',
    { name: 'styles',      items : [ 'Styles','Format','Font','FontSize' ] },
    { name: 'colors',      items : [ 'TextColor','BGColor' ] },
    { name: 'tools',       items : [ 'Maximize', 'ShowBlocks' ] }
];};
CONFIG.XML
<config>
<!--
CKFinder : Configuration File - Basic Instructions

In a generic usage case, the following tasks must be done to configure CKFinder:
1. Check the baseDir and baseUrl options;
2. If available, paste your license key in the "licenseKey" setting;
3. Enable CKFinder using the "enabled" setting. WARNING : DO NOT simply set "enabled" to "true" on a production site. By doing so, you 
are allowing "anyone" to upload and list the files in your server. You must implement
some kind of session validation.
http://docs.cksource.com/CKFinder_2.x/Developers_Guide/Java/Configuration/Extending
-->
<enabled>true</enabled>
<!--
Configure the location of uploaded files. See the following article for more details:
http://docs.cksource.com/CKFinder_2.x/Developers_Guide/Java/Configuration/baseURL_and_baseDir
-->
<baseDir></baseDir>
<baseURL>/userfiles/</baseURL>
<licenseKey></licenseKey>
<licenseName></licenseName>
<!--
Set the maximum size of uploaded images. If an uploaded image is larger, it
gets scaled down proportionally. Set to 0 to disable this feature.
-->
<imgWidth>1600</imgWidth>
<imgHeight>1200</imgHeight>
<imgQuality>80</imgQuality>
<!--
See the following article for more details:
http://docs.cksource.com/CKFinder_2.x/Developers_Guide/Java/Configuration/URI_Encoding
-->
<uriEncoding>UTF-8</uriEncoding>
<!--
ResourceType : defines the "resource types" handled in CKFinder. A resource
type is nothing more than a way to group files under different paths, each one
having different configuration settings. Each resource type name must be unique. When loading CKFinder, the "type" querystring parameter can be used to display
a specific type only. If "type" is omitted in the URL, the
"DefaultResourceTypes" settings is used (may contain the resource type names
separated by a comma). If left empty, all types are loaded. maxSize is defined in bytes, but shorthand notation may be also used.
Available options are: G, M, K (case insensitive).
1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte.
Example: 'maxSize' => "8M", ==============================================================================
ATTENTION: Flash files with `swf' extension, just like HTML files, can be used 
to execute JavaScript code and to e.g. perform an XSS attack. Grant permission 
to upload `.swf` files only if you understand and can accept this risk.
==============================================================================
-->
<defaultResourceTypes></defaultResourceTypes>
<types>
<type name="Files">
<url>%BASE_URL%files/</url>
<directory>%BASE_DIR%files</directory>
<maxSize>0</maxSize>
<allowedExtensions>7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip
</allowedExtensions>
<deniedExtensions></deniedExtensions>
</type>
<type name="Images">
<url>%BASE_URL%images/</url>
<directory>%BASE_DIR%images</directory>
<maxSize>0</maxSize>
<allowedExtensions>bmp,gif,jpeg,jpg,png</allowedExtensions>
<deniedExtensions></deniedExtensions>
</type>
<type name="Flash">
<url>%BASE_URL%flash/</url>
<directory>%BASE_DIR%flash</directory>
<maxSize>0</maxSize>
<allowedExtensions>swf,flv</allowedExtensions>
<deniedExtensions></deniedExtensions>
</type>
</types>
<!--
The session variable name that CKFinder must use to retrieve
the "role" of the current user. The "role", can be used in the "accessControls"
settings (bellow).
-->
<userRoleSessionVar>CKFinder_UserRole</userRoleSessionVar>
<accessControls>
<accessControl>
<role>*</role>
<resourceType>*</resourceType>
<folder>/</folder>
<folderView>true</folderView>
<folderCreate>true</folderCreate>
<folderRename>true</folderRename>
<folderDelete>true</folderDelete>
<fileView>true</fileView>
<fileUpload>true</fileUpload>
<fileRename>true</fileRename>
<fileDelete>true</fileDelete>
</accessControl>
</accessControls>
<thumbs>
<enabled>true</enabled>
<url>%BASE_URL%_thumbs/</url>
<directory>%BASE_DIR%_thumbs</directory>
<directAccess>false</directAccess>
<maxHeight>100</maxHeight>
<maxWidth>100</maxWidth>
<quality>80</quality>
</thumbs>
<!--
Increases the security on an IIS web server.
If enabled, CKFinder will disallow creating folders and uploading files whose names contain characters 
that are not safe under an IIS web server.
-->
<disallowUnsafeCharacters>false</disallowUnsafeCharacters>
<!--
Due to security issues with Apache modules, it is recommended to leave the
following setting enabled. How does it work? Suppose the following: - If "php" is on the denied extensions list, a file named foo.php cannot be
  uploaded.
- If "rar" (or any other) extension is allowed, one can upload a file named
  foo.rar.
- The file foo.php.rar has "rar" extension so, in theory, it can be also
  uploaded. In some conditions Apache can treat the foo.php.rar file just like any PHP
script and execute it. If CheckDoubleExtension is enabled, each part of the file name after a dot is
checked, not only the last part. In this way, uploading foo.php.rar would be
denied, because "php" is on the denied extensions list.
-->
<checkDoubleExtension>true</checkDoubleExtension>
<!--
Indicates that the file size (maxSize) for images must be checked only
after scaling them. Otherwise, it is checked right after uploading.
-->
<checkSizeAfterScaling>true</checkSizeAfterScaling>
<!--
Perform additional checks for image files
if set to true, validate image size
-->
<secureImageUploads>true</secureImageUploads>
<!--
For security, HTML is allowed in the first Kb of data for files having the
following extensions only.
-->
<htmlExtensions>html,htm,xml,js</htmlExtensions>
<!--
Force ASCII names for files and folders. If enabled, characters with diactric 
s will be automatically converted to ASCII letters.
-->
<forceASCII>false</forceASCII>
<!--
Folders to not display in CKFinder, no matter their location.
No paths are accepted, only the folder name.
The * and ? wildcards are accepted.
".*" disallows the creation of folders starting with a dot character.
-->
<hideFolders>
<folder>.*</folder>
<folder>CVS</folder>
</hideFolders>
<!--
Files to not display/upload in CKFinder, no matter their location.
No paths are accepted, only the file name, including extension.
The * and ? wildcards are accepted.
-->
<hideFiles>
<file>.*</file>
</hideFiles>
<plugins>
<plugin>
<name>imageresize</name>
<class>com.ckfinder.connector.plugins.ImageResize</class>
<params>
<param name="smallThumb" value="90x90"></param>
<param name="mediumThumb" value="120x120"></param>
<param name="largeThumb" value="180x180"></param>
</params>
</plugin>
<plugin>
<name>fileeditor</name>
<class>com.ckfinder.connector.plugins.FileEditor</class>
<params></params>
</plugin>
</plugins>
<basePathBuilderImpl>com.ckfinder.connector.configuration.ConfigurationPathBuilder</basePathBuilderImpl>
</config>
尝试过很多地方加项目路径都失败了。求大神指点  真心跪了ckeditorckfinder路径

解决方案 »

  1.   

    lebrowserBrowseUrl = '/project/ckfinder/ckfinder.html'
        config.filebrowserImageBrowseUrl = '/project/ckfinder/ckfinder.html?type=Images'
        config.filebrowserFlashBrowseUrl = '/project/ckfinder/ckfinder.html?type=Flash'
        config.filebrowserUploadUrl = '/project/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Files'
        config.filebrowserImageUploadUrl = '/project/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Images'
        config.filebrowserFlashUploadUrl = '/project/ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Flash'试试
      

  2.   

    找到问题所在了 <ckfinder:setupCKEditor basePath="../../ckfinder/" editor="content" />
    <ckeditor:replace replace="content" basePath="ckeditor/" /> 
    原来是根据这个basePath路径来的  原来写的是 basePath="/ckfinder/" 所以出错了 
    不过貌似版本不一样也会有问题。2.2和2.3貌似有问题