ICEfaces
  1. ICEfaces
  2. ICE-7100

The ckeditor.js resource does not reload after cookies are cleared

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 3.0.RC2, 3.0
    • Labels:
      None
    • Environment:
      ICEfaces 2, Rich Text Editor

      Description

      The Component Showcase preloads the resources required for the Rich Input Text editor so that they are in the head before the component is dynamically added to the page.

      To recreate the problem:

      1) Load the component showcase main page. Check Firebug or the console for whatever browser you are using and ensure that the resource loaded. The resource link typically looks like this:

       http://localhost:8080/component-showcase/icefaces/resource/LTE5NDk5MzQyNTU=//ckeditor.js

      There is also related resource links that look like this:

      http://localhost:8080/component-showcase/icefaces/resource/LTE5NDk5MzQyNTU=/

      2) Clear cookies from your browser.

      3) Reload the page. The above resource links will result in a 404 Not found. The response content comes from the SessionBasedResourceDispatcher:

                  externalContext.responseSendError(404, "Could not find requested dynamic resource.");

      Because it's a Session based dispatcher, clearing the cookies also removes the session id. However, because the resources don't reload, the Rich Input Text no longer functions.

        Activity

        Hide
        Mircea Toma added a comment -

        Brad, have you rebuilt also icefaces-compat.jar before testing?

        Show
        Mircea Toma added a comment - Brad, have you rebuilt also icefaces-compat.jar before testing?
        Hide
        Deryk Sinotte added a comment -

        I just ran the original problem scenario using the latest head revision:

        URL: http://server.ice:8888/svn/ossrepo/icefaces2/trunk/icefaces
        Repository Root: http://server.ice:8888/svn/ossrepo
        Repository UUID: 8668f098-c06c-11db-ba21-f49e70c34f74
        Revision: 25404
        Node Kind: directory
        Schedule: normal
        Last Changed Author: mircea.toma
        Last Changed Rev: 25403
        Last Changed Date: 2011-09-05 09:06:11 -0700 (Mon, 05 Sep 2011)

        And the behaviour seems fine now. Need to Brad to confirm that it's fixed or provide specific way to reproduce.

        Show
        Deryk Sinotte added a comment - I just ran the original problem scenario using the latest head revision: URL: http://server.ice:8888/svn/ossrepo/icefaces2/trunk/icefaces Repository Root: http://server.ice:8888/svn/ossrepo Repository UUID: 8668f098-c06c-11db-ba21-f49e70c34f74 Revision: 25404 Node Kind: directory Schedule: normal Last Changed Author: mircea.toma Last Changed Rev: 25403 Last Changed Date: 2011-09-05 09:06:11 -0700 (Mon, 05 Sep 2011) And the behaviour seems fine now. Need to Brad to confirm that it's fixed or provide specific way to reproduce.
        Hide
        Brad Kroeger added a comment -

        Could not reproduce this issue in the poc from Grimlock head using JSF 2.1.3 jars.

        Show
        Brad Kroeger added a comment - Could not reproduce this issue in the poc from Grimlock head using JSF 2.1.3 jars.
        Hide
        Deryk Sinotte added a comment -

        We'll need to ensure that this works on WebSphere for the next EE release. Part of the testing for Component Showcase must include clearing cache/cookies and reloading.

        Some quick testing on Williams app (where the problem manifested) indicates that perhaps the extra slash in the resource URL is not handled in WebSphere. So rather than:

        http://172.31.50.58:9080/1Line/icefaces/resource/LTE5NDk5MzQyNTU=//ckeditor.js

        removing the extra slash in front of ckeditor.js works when typed in manually:

        http://172.31.50.58:9080/1Line/icefaces/resource/LTE5NDk5MzQyNTU=/ckeditor.js

        So in InputRichTextSetup:

        public void processEvent(SystemEvent event) throws AbortProcessingException {
        final FacesContext context = FacesContext.getCurrentInstance();
        if (EnvUtils.isICEfacesView(context)) {
        UIViewRoot root = context.getViewRoot();

        UIOutput inputTextJS = new UIOutputWriter() {
        public void encode(ResponseWriter writer, FacesContext context) throws IOException

        { String clientID = getClientId(context); writer.startElement("script", this); writer.writeAttribute("id", clientID + "JS", null); //Remove extra slash //writer.writeAttribute("src", getURI(context) + "/ckeditor.js", "src"); writer.writeAttribute("src", getURI(context) + "ckeditor.js", "src"); writer.endElement("script"); writer.startElement("script", this); writer.writeAttribute("id", clientID + "JSWrpr", null); writer.writeAttribute("src", getURI(context), null); writer.endElement("script"); }

        };
        inputTextJS.setTransient(true);
        inputTextJS.setId("inpRichTxt");

        root.addComponentResource(context, inputTextJS, "head");
        }
        }

        Show
        Deryk Sinotte added a comment - We'll need to ensure that this works on WebSphere for the next EE release. Part of the testing for Component Showcase must include clearing cache/cookies and reloading. Some quick testing on Williams app (where the problem manifested) indicates that perhaps the extra slash in the resource URL is not handled in WebSphere. So rather than: http://172.31.50.58:9080/1Line/icefaces/resource/LTE5NDk5MzQyNTU=//ckeditor.js removing the extra slash in front of ckeditor.js works when typed in manually: http://172.31.50.58:9080/1Line/icefaces/resource/LTE5NDk5MzQyNTU=/ckeditor.js So in InputRichTextSetup: public void processEvent(SystemEvent event) throws AbortProcessingException { final FacesContext context = FacesContext.getCurrentInstance(); if (EnvUtils.isICEfacesView(context)) { UIViewRoot root = context.getViewRoot(); UIOutput inputTextJS = new UIOutputWriter() { public void encode(ResponseWriter writer, FacesContext context) throws IOException { String clientID = getClientId(context); writer.startElement("script", this); writer.writeAttribute("id", clientID + "JS", null); //Remove extra slash //writer.writeAttribute("src", getURI(context) + "/ckeditor.js", "src"); writer.writeAttribute("src", getURI(context) + "ckeditor.js", "src"); writer.endElement("script"); writer.startElement("script", this); writer.writeAttribute("id", clientID + "JSWrpr", null); writer.writeAttribute("src", getURI(context), null); writer.endElement("script"); } }; inputTextJS.setTransient(true); inputTextJS.setId("inpRichTxt"); root.addComponentResource(context, inputTextJS, "head"); } }
        Hide
        Deryk Sinotte added a comment -

        I removed the extra slash as described above and tested it on Tomcat + Component Showcase with no ill effects. The change is now checked into the icefaces2/trunk

        Show
        Deryk Sinotte added a comment - I removed the extra slash as described above and tested it on Tomcat + Component Showcase with no ill effects. The change is now checked into the icefaces2/trunk

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: