tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject Re: Be more generic for tld checking in the Compiler.isOutDated()
Date Thu, 02 Aug 2012 15:44:02 GMT
Any comment for this ? Now, the JSP file will be recompiled each time even
no change is done. The most reason is that, e.g. a file:// URL is used for
TLD file.

2012/8/1 Ivan <xhhsld@gmail.com>

> 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
>



-- 
Ivan

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