DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26276

Generated TLD inconsistent after tagfile changes





------- Additional Comments From [EMAIL PROTECTED]  2004-01-21 13:50 -------
I did some more research. This is actually what happens: If both the jsp using
the tag and the tagfile have been modified, the tag class is generated but with
an outdated TagInfo, thus the source code contains the old state (e.g. attributes).

This is because the old wrapper is not removed from the wrapperCache in
JspRuntimeContext and the associated CompilationContext containing the outdated
TagInfo is used for generating the tag's source code. After that it's a real
mess because the timestamp of the tag of coures has changed and therefore jasper
thinks the generated tag is up to date.

To fix this I put the following lines in the method Compiler.isOutDated(boolean)

        targetLastModified = targetFile.lastModified();
        if (targetLastModified < jspRealLastModified) {
+            if(ctxt.isTagFile()){
+               ctxt.getRuntimeContext().removeWrapper(ctxt.getJspFile());
+            }
            if (log.isDebugEnabled())
                log.debug("Compiler: outdated: " + targetFile + " " +
targetLastModified);
            return true;
        }

I'm new to jasper and anything but sure that this is a valid solution or if it
has negative side effects but as far as I can see it seems to work. I'm not sure
why removeWrapper is currently only called when a tag file is found to be
modified as part of the dependents list of a jsp (which is why it does not work
now if the jsp was modified as well because isOutDated returns before it gets to
that check).

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to