impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
/**
     * Template method for determining if the Facelet needs to be refreshed.
     * 
     * @param facelet
     *            Facelet that could have expired
     * @return true if it needs to be refreshed
     */
Template method for determining if the Facelet needs to be refreshed.

@param facelet
Facelet that could have expired
@return true if it needs to be refreshed
Template method for determining if the Facelet needs to be refreshed . @param facelet Facelet that could have expired @return true if it needs to be refreshed
protected boolean needsToBeRefreshed(DefaultFacelet facelet)
    {
        if (_refreshPeriod == NO_CACHE_DELAY)
        {
            return true;
        }
        if (_refreshPeriod == INFINITE_DELAY)
        {
            return false;
        }
        long target = facelet.getCreateTime() + _refreshPeriod;
        if (System.currentTimeMillis() > target)
        {
            URLConnection conn = null;
            try
            {
                conn = facelet.getSource().openConnection();
                long lastModified = ResourceLoaderUtils.getResourceLastModified(conn);
                return lastModified == 0 || lastModified > target;
            }
            catch (IOException e)
            {
                throw new FaceletException("Error Checking Last Modified for " + facelet.getAlias(), e);
            }
            finally
            {
                if (conn != null)
                {
                    try
                    {
                        conn.getInputStream().close();
                    }
                    catch (Exception e)
                    {
                    }
                }
            }
        }
        return false;
    }
protected boolean needsToBeRefreshed ( DefaultFacelet facelet ) { if ( _refreshPeriod == NO_CACHE_DELAY ) { return true ; } if ( _refreshPeriod == INFINITE_DELAY ) { return false ; } long target = facelet . getCreateTime ( ) + _refreshPeriod ; if ( System . currentTimeMillis ( ) > target ) { URLConnection conn = null ; try { conn = facelet . getSource ( ) . openConnection ( ) ; long lastModified = ResourceLoaderUtils . getResourceLastModified ( conn ) ; return lastModified == 0 || lastModified > target ; } catch ( IOException e ) { throw new FaceletException ( "Error Checking Last Modified for " + facelet . getAlias ( ) , e ) ; } finally { if ( conn != null ) { try { conn . getInputStream ( ) . close ( ) ; } catch ( Exception e ) { } } } } return false ; }
Template method for determining if the Facelet needs to be refreshed.
Template method for determining if the Facelet needs to be refreshed .
// if set to 0, constantly reload-- nocache // if set to -1, never reload // Should check for file modification // Ignored