tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject Be more generic for tld checking in the Compiler.isOutDated()
Date Wed, 01 Aug 2012 15:27:01 GMT
Hi, while checking whether the JSP file is out of date in the
Compiler.isOutDated(), the codes will check whether there is any update for
the tld files used in JSP. Now, the codes are like below :

 Iterator<Entry<String,Long>> it = depends.entrySet().iterator();
        while (it.hasNext()) {
            Entry<String,Long> include = it.next();
            try {
                String key = include.getKey();
                URL includeUrl;

                // Currently, the codes will first check whether is of jar
protocol, if not, it will try to get the URL with
JspCompilationContext.getResource().
                // This is correct in most cases, while Geronimo tries to
support to reference tld from other places, the string may be file URL
based.
                // Is it possible to update the codes to make the checking
more generic
                // e.g. if(key.indexOf(":") !=-1) {
                          try {
                             includeUrl = new URL(key);
                          } catch(MalformedURLException e) {}
                          }
                // If it is reasonable, I would like to open a JIRA for
that. Thanks.

                if (key.startsWith("jar:")) {
                    includeUrl = new URL(key);
                } else {
                    includeUrl = ctxt.getResource(include.getKey());
                }
                if (includeUrl == null) {
                    return true;
                }

                ......
            } catch (Exception e) {
                if (log.isDebugEnabled())
                    log.debug("Problem accessing resource. Treat as
outdated.",
                            e);
                return true;
            }
        }

-- 
Ivan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message