javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2316

Resource dependencies should not be cached in Development

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.1.15, 2.2.0-m07
    • Component/s: configuration
    • Labels:
      None
    • Environment:

      Java 1.6

      Description

      We are finding development very difficult at the moment as our javascript files are declared as a ResourceDependency, after debugging the code I've seen that these will always be loaded from a cached method so we have to restart the server everytime we make a small change to any javascript file, making work 3 to 4 times slower.

      Please could you update the code in com.sun.faces.application.resource.ClasspathResourceHelper.getNonCompressedInputStream(ResourceInfo resource, FacesContext ctx) to simply be :

      if( /* application in development mode */ ) {
      InputStream in = loader.getResource(path).openStream();
      if (in == null)

      { // try using this class' loader (necessary when running in OSGi) in = this.getClass().getClassLoader().getResource(path).openStream(); }

      } else {
      InputStream in = loader.getResourceAsStream(path);
      if (in == null)

      { // try using this class' loader (necessary when running in OSGi) in = this.getClass().getClassLoader().getResourceAsStream(path); }

      }

      I'd be very happy to see this in the next patch version as this is killing our javascript development, which is about to become our focus for the next few months.

        Issue Links

          Activity

          Hide
          Manfred Riem added a comment -

          Applied to 2.1 branch,

          svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2316, r=rogerk, changes to make sure resources dependencies are not cached during Development."
          Sending jsf-ri\src\main\java\com\sun\faces\application\resource\ClasspathResourceHelper.java
          Transmitting file data .
          Committed revision 10996.

          Show
          Manfred Riem added a comment - Applied to 2.1 branch, svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2316 , r=rogerk, changes to make sure resources dependencies are not cached during Development." Sending jsf-ri\src\main\java\com\sun\faces\application\resource\ClasspathResourceHelper.java Transmitting file data . Committed revision 10996.
          Hide
          Manfred Riem added a comment -

          Applied to 2.2 trunk,

          svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2316, r=rogerk, changes to make sure resources dependencies are not cached during Development."
          Sending jsf-ri\src\main\java\com\sun\faces\application\resource\ClasspathResourceHelper.java
          Transmitting file data .
          Committed revision 10997.

          Show
          Manfred Riem added a comment - Applied to 2.2 trunk, svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2316 , r=rogerk, changes to make sure resources dependencies are not cached during Development." Sending jsf-ri\src\main\java\com\sun\faces\application\resource\ClasspathResourceHelper.java Transmitting file data . Committed revision 10997.
          Hide
          aplossystems added a comment -

          Thanks for this Manfred, I've made use of this for the first time today, it's only a small update but it's going to save hours over the year

          Show
          aplossystems added a comment - Thanks for this Manfred, I've made use of this for the first time today, it's only a small update but it's going to save hours over the year

            People

            • Assignee:
              Manfred Riem
              Reporter:
              aplossystems
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 15 minutes
                15m
                Remaining:
                Remaining Estimate - 15 minutes
                15m
                Logged:
                Time Spent - Not Specified
                Not Specified