https://issues.apache.org/bugzilla/show_bug.cgi?id=50455

           Summary: Jasper don't detects changes in jsp file if we load de
                    jsp and after we modify the jsp in the same second
           Product: Tomcat 7
           Version: 7.0.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: a...@enforex.es


If we have a jsp file (not in a war file; just directly in the file system)
then we first call the jsp; then it is compiled and executed.
But if after this, the jsp file is modified very very fast (by an external
process for example), then, jasper does not detect the change and then do not
recompile the file, and so on, we do not see the change with the first version.

this is because in the class:

org/apache/jasper/compiler/Compiler.java

in the line 442 is like:

'if (targetLastModified < jspRealLastModified)'

Why is the error? because in some systems, the method lastModified or
getLastModified does not care miliseconds and return units in seconds.

Then, if we first compile, and after (in the same second) we modify the jsp
file, as the functions ignores miliseconds units, then jspRealLastModified is
equals to 
targetLastModified (BUT IT IS NOT).

So I think is that the solution is very simple. Change the condition from:

'if (targetLastModified < jspRealLastModified)'

to

'if (targetLastModified <= jspRealLastModified)'


I tried this and it works.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to