Changeset 6764


Ignore:
Timestamp:
Mar 10, 2015, 8:13:22 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1927: Test BASE with Tomcat 8

Fixes a NullPointerException since getServletContext().getResourcePaths(dir) return null when the dir has no files. Saw this inside a .svn directory so the code has also be updated to not go into directories starting with '.'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/servlet/CompileAll.java

    r6418 r6764  
    155155    PrintWriter out = response.getWriter();
    156156    boolean ok = true;
     157    out.print("<b>Entering directory: <code>" + dir + "</code></b><br>");
    157158   
    158159    // Get all files in the "dir" directory
     160    Set<String> res = getServletContext().getResourcePaths(dir);
     161    if (res == null || res.size() == 0) return ok;
    159162    Set<String> all = new TreeSet<String>(pathComparator);
    160     all.addAll(getServletContext().getResourcePaths(dir));
     163    all.addAll(res);
    161164   
    162165    for (String path : all)
    163166    {
     167      if (path.contains("/.") || path.startsWith("/WEB-INF")) continue;
     168     
    164169      if (path.endsWith(".jsp"))
    165170      {
    166         out.print("Compiling: " + path + " ... ");
     171        out.print("Compiling: <code>" + path + "</code> ... ");
    167172        out.flush();
    168173        RequestDispatcher rd = getServletContext().getRequestDispatcher(path);
Note: See TracChangeset for help on using the changeset viewer.