-1

I get the below error when I click browse-server button in the CKEditor's Image panel:

HTTP Status 404 - /elecMaven/system/$%7BpageContext.request.contextPath%7D/ckfinder/ckfinder.html

type Status report

message /elecMaven/system/$%7BpageContext.request.contextPath%7D/ckfinder/ckfinder.html

description The requested resource is not available. Apache Tomcat/7.0.75

enter image description here

My ckeditor/config.js is below:

CKEDITOR.editorConfig = function( config )
{

    //配置默认配置
    config.language = 'zh-cn'; //配置语言
    config.uiColor = '#FFF'; //背景颜色
    config.width = 400; //宽度
    config.height = 400; //高度
    config.skin = 'office2003'; //编辑器皮肤样式

    config.resize_enabled = false;

    config.toolbar =
     [
     ['Source', '-'],
     ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ],
     ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
     ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar','PageBreak'],
     '/',
     ['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript'],
     ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],
     ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
     ['Link', 'Unlink', 'Anchor'],
     '/',
     ['Format', 'Font', 'FontSize'],
    ['TextColor', 'BGColor'],
     ['Maximize', 'ShowBlocks', '-', 'About']
     ];


/*** File upload-----------------------
     */
    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';

};

My config.xml under WEB-INF:

<config>

    <enabled>true</enabled>
    <baseDir></baseDir>
    <baseURL>/userfiles/</baseURL>
    <licenseKey></licenseKey>
    <licenseName></licenseName>
    <imgWidth>1600</imgWidth>
    <imgHeight>1200</imgHeight>
    <imgQuality>80</imgQuality>
    <uriEncoding>UTF-8</uriEncoding>

    <defaultResourceTypes></defaultResourceTypes>
    <types>
        <type name="Files">
            <url>/elecMaven%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>/itheima1128elec%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>/itheima1128elec%BASE_URL%flash/</url>
            <directory>%BASE_DIR%flash</directory>
            <maxSize>0</maxSize>
            <allowedExtensions>swf,flv</allowedExtensions>
            <deniedExtensions></deniedExtensions>
        </type>
    </types>

    <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>

    <disallowUnsafeCharacters>false</disallowUnsafeCharacters>

    <checkDoubleExtension>true</checkDoubleExtension>

    <checkSizeAfterScaling>true</checkSizeAfterScaling>

    <secureImageUploads>true</secureImageUploads>

    <htmlExtensions>html,htm,xml,js</htmlExtensions>

    <forceASCII>false</forceASCII>

    <hideFolders>
        <folder>.*</folder>
        <folder>CVS</folder>
    </hideFolders>

    <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>

And my CKEditor configuration in web.xml is below:

<!-- CKEditor+CKFinder,being -->
    <servlet>
        <servlet-name>ConnectorServlet</servlet-name>
        <servlet-class>com.ckfinder.connector.ConnectorServlet</servlet-class>
        <init-param>
            <param-name>XMLConfig</param-name>
            <param-value>/WEB-INF/config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>ConnectorServlet</servlet-name>
        <url-pattern>
            /ckfinder/core/connector/java/connector.java
        </url-pattern>
    </servlet-mapping>
    <filter>
        <filter-name>FileUploadFilter</filter-name>
        <filter-class>com.ckfinder.connector.FileUploadFilter</filter-class>
        <init-param>
            <param-name>sessionCookieName</param-name>
            <param-value>JSESSIONID</param-value>
        </init-param>
        <init-param>
            <param-name>sessionParameterName</param-name>
            <param-value>jsessionid</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>FileUploadFilter</filter-name>
        <url-pattern>
            /ckfinder/core/connector/java/connector.java
        </url-pattern>
    </filter-mapping>
    <session-config>
        <session-timeout>10</session-timeout>
    </session-config>
    <!-- CKEditor+CKFinder,end -->

I don't know where is the issue, some one can help me?

My 运行监控's data in menuData.js, which is loaded by the ztree, in the above image, you can find the 运行监控:

   {
        mid:'ap',
        pid:'am',
        name:'运行监控',
        icon:'../images/MenuIcon/daibanshiyi.gif',
        target:'mainFrame',
 url:'${pageContext.request.contextPath}/system/elecCommonMsgAction_home.do',
                isParent:false
            }

If I change the 运行监控's url to:

url:'${pageContext.request.contextPath123}/system/elecCommonMsgAction_home.do'

The error will become:

HTTP Status 404 - /elecMaven/system/$%7BpageContext.request.contextPath123%7D/ckfinder/ckfinder.html

I struggle with the issue, but I can not defeat it.


Addtional -1

My project library:

config.xml and web.xml location:

struts.xml location:

user7693832
  • 6,119
  • 19
  • 63
  • 114
  • The HTTP 404 Not Found Error means that the webpage you were trying to reach could not be found on the server. It is a Client-side Error which means that either the page has been removed or moved and the URL was not changed accordingly, or that you typed in the URL incorrectly. – Mark Schultheiss Apr 09 '17 at 02:27
  • 1
    `${pageContext.request.contextPath123}` is a JSP EL expression. `.js` files are static, and not generated by the Servlet JSP engine, which is why it wasn't replaced by the intended value. – Andreas Apr 09 '17 at 02:29
  • @MarkSchultheiss i really don't know where is my mistake, I am go crazy. – user7693832 Apr 09 '17 at 02:30
  • @Andreas thanks, you save my day. – user7693832 Apr 09 '17 at 02:35

1 Answers1

0

Change your url of menuData to :

url:'../system/elecCommonMsgAction_home.do',

Because the ${pageContext.request.contextPath} can not analysis in .js file.

three-blocks
  • 353
  • 1
  • 4
  • 20