View | Details | Raw Unified | Return to bug 33453
Collapse All | Expand All

(-)Generator.java.original (-3 / +46 lines)
Lines 31-36 Link Here
31
import java.util.Iterator;
31
import java.util.Iterator;
32
import java.util.List;
32
import java.util.List;
33
import java.util.Vector;
33
import java.util.Vector;
34
import java.net.URL;
35
import java.net.URLConnection;
34
36
35
import javax.servlet.jsp.tagext.TagAttributeInfo;
37
import javax.servlet.jsp.tagext.TagAttributeInfo;
36
import javax.servlet.jsp.tagext.TagInfo;
38
import javax.servlet.jsp.tagext.TagInfo;
Lines 430-435 Link Here
430
        // Static data for getDependants()
432
        // Static data for getDependants()
431
        out.printil("private static java.util.Vector _jspx_dependants;");
433
        out.printil("private static java.util.Vector _jspx_dependants;");
432
        out.println();
434
        out.println();
435
        out.printil("private static java.util.HashMap _jspx_dependant_to_last_modified = new java.util.HashMap();"); 
436
        out.println();
437
        out.printin("private static long _jspx_last_modified = ");
438
        try {
439
           String jsp = ctxt.getJspFile();
440
           URL jspUrl = ctxt.getResource(jsp);
441
           URLConnection uc = jspUrl.openConnection();
442
           long jspLastModified = uc.getLastModified();
443
           uc.getInputStream().close();
444
           out.print(Long.toString(jspLastModified));
445
        }
446
        catch (java.io.IOException ioe) {
447
           throw new JasperException(ioe);   
448
        }
449
        out.println("L;");
433
        List dependants = pageInfo.getDependants();
450
        List dependants = pageInfo.getDependants();
434
        Iterator iter = dependants.iterator();
451
        Iterator iter = dependants.iterator();
435
        if (!dependants.isEmpty()) {
452
        if (!dependants.isEmpty()) {
Lines 438-447 Link Here
438
            out.printin("_jspx_dependants = new java.util.Vector(");
455
            out.printin("_jspx_dependants = new java.util.Vector(");
439
            out.print("" + dependants.size());
456
            out.print("" + dependants.size());
440
            out.println(");");
457
            out.println(");");
441
            while (iter.hasNext()) {
458
            while (iter.hasNext()) {        
459
                String include = (String)iter.next();
442
                out.printin("_jspx_dependants.add(\"");
460
                out.printin("_jspx_dependants.add(\"");
443
                out.print((String)iter.next());
461
                out.print(include);
444
                out.println("\");");
462
                out.println("\");");
463
                out.printin("_jspx_dependant_to_last_modified.put(\"");
464
                out.print(include);
465
                out.print("\", new java.lang.Long(");
466
                try {
467
                    URL includeUrl = ctxt.getResource(include);
468
                    URLConnection includeUconn = includeUrl.openConnection();
469
                    long includeLastModified = includeUconn.getLastModified();
470
                    out.print(Long.toString(includeLastModified));
471
                    includeUconn.getInputStream().close();                    
472
                }
473
                catch (java.io.IOException ioe) {
474
                    throw new JasperException(ioe);   
475
                }
476
                out.println("L));");
445
            }
477
            }
446
            out.popIndent();
478
            out.popIndent();
447
            out.printil("}");
479
            out.printil("}");
Lines 479-485 Link Here
479
        out.popIndent();
511
        out.popIndent();
480
        out.printil("}");
512
        out.printil("}");
481
        out.println();
513
        out.println();
482
514
        out.printil("public java.util.Map getDependantToLastModified() {");
515
        out.pushIndent();
516
        out.printil("return _jspx_dependant_to_last_modified;");
517
        out.popIndent();
518
        out.printil("}");
519
        out.println();
520
        out.printil("public long getLastModified() {");
521
        out.pushIndent();
522
        out.printil("return _jspx_last_modified;");
523
        out.popIndent();
524
        out.printil("}");
525
        out.println();
483
        if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
526
        if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
484
            generateInit();
527
            generateInit();
485
            generateDestroy();
528
            generateDestroy();

Return to bug 33453