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

(-)apache-tomcat-6.0.14-src-orig\java\org\apache\catalina\manager\ManagerServlet.java (-1 / +1 lines)
Lines 1353-1359 Link Here
1353
                    // Ignore
1353
                    // Ignore
1354
                }
1354
                }
1355
                try {
1355
                try {
1356
                    File war = new File(getAppBase(), getDocBase(path) + ".war");
1356
                    File war = new File(getAppBase(), getDocBase(path).replace( "/", "#" ) + ".war");
1357
                    File dir = new File(getAppBase(), getDocBase(path));
1357
                    File dir = new File(getAppBase(), getDocBase(path));
1358
                    File xml = new File(configBase, getConfigFile(path) + ".xml");
1358
                    File xml = new File(configBase, getConfigFile(path) + ".xml");
1359
                    if (war.exists()) {
1359
                    if (war.exists()) {
(-)apache-tomcat-6.0.14-src-orig\java\org\apache\catalina\startup\ContextConfig.java (-2 / +2 lines)
Lines 881-892 Link Here
881
        file = new File(docBase);
881
        file = new File(docBase);
882
        String origDocBase = docBase;
882
        String origDocBase = docBase;
883
        
883
        
884
        String contextPath = context.getPath();
884
        String contextPath = context.getPath().replace( '#', '/' );
885
        if (contextPath.equals("")) {
885
        if (contextPath.equals("")) {
886
            contextPath = "ROOT";
886
            contextPath = "ROOT";
887
        }
887
        }
888
        if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && unpackWARs) {
888
        if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && unpackWARs) {
889
            URL war = new URL("jar:" + (new File(docBase)).toURL() + "!/");
889
            URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() + "!/");
890
            docBase = ExpandWar.expand(host, war, contextPath);
890
            docBase = ExpandWar.expand(host, war, contextPath);
891
            file = new File(docBase);
891
            file = new File(docBase);
892
            docBase = file.getCanonicalPath();
892
            docBase = file.getCanonicalPath();
(-)apache-tomcat-6.0.14-src-orig\java\org\apache\catalina\startup\ExpandWar.java (-1 / +1 lines)
Lines 130-136 Link Here
130
        }
130
        }
131
131
132
        // Create the new document base directory
132
        // Create the new document base directory
133
        docBase.mkdir();
133
        docBase.mkdirs();
134
134
135
        // Expand the WAR into the new document base directory
135
        // Expand the WAR into the new document base directory
136
        JarURLConnection juc = (JarURLConnection) war.openConnection();
136
        JarURLConnection juc = (JarURLConnection) war.openConnection();
(-)apache-tomcat-6.0.14-src-orig\java\org\apache\catalina\startup\HostConfig.java (-4 / +20 lines)
Lines 477-482 Link Here
477
477
478
    
478
    
479
    /**
479
    /**
480
     * Given an application name, get the context path
481
     */
482
    protected String getContextPath(String appName) {
483
    	String contextPath = null;
484
    	if (appName.equals("")) {
485
    		contextPath = "/";
486
    	} else {
487
    		contextPath = appName.replace('#', '/');
488
    	}
489
    	return (contextPath);
490
    }
491
    
492
    
493
    
494
    /**
480
     * Deploy applications for any directories or WAR files that are found
495
     * Deploy applications for any directories or WAR files that are found
481
     * in our "application root" directory.
496
     * in our "application root" directory.
482
     */
497
     */
Lines 504-522 Link Here
504
        File configBase = configBase();
519
        File configBase = configBase();
505
        String baseName = getConfigFile(name);
520
        String baseName = getConfigFile(name);
506
        String docBase = getConfigFile(name);
521
        String docBase = getConfigFile(name);
522
        String contextPath = getContextPath(name);
507
        
523
        
508
        // Deploy XML descriptors from configBase
524
        // Deploy XML descriptors from configBase
509
        File xml = new File(configBase, baseName + ".xml");
525
        File xml = new File(configBase, baseName + ".xml");
510
        if (xml.exists())
526
        if (xml.exists())
511
            deployDescriptor(name, xml, baseName + ".xml");
527
            deployDescriptor(contextPath, xml, baseName + ".xml");
512
        // Deploy WARs, and loop if additional descriptors are found
528
        // Deploy WARs, and loop if additional descriptors are found
513
        File war = new File(appBase, docBase + ".war");
529
        File war = new File(appBase, docBase + ".war");
514
        if (war.exists())
530
        if (war.exists())
515
            deployWAR(name, war, docBase + ".war");
531
            deployWAR( contextPath, war, docBase + ".war");
516
        // Deploy expanded folders
532
        // Deploy expanded folders
517
        File dir = new File(appBase, docBase);
533
        File dir = new File(appBase, docBase);
518
        if (dir.exists())
534
        if (dir.exists())
519
            deployDirectory(name, dir, docBase);
535
            deployDirectory(contextPath, dir, docBase);
520
        
536
        
521
    }
537
    }
522
538
Lines 699-705 Link Here
699
            if (files[i].toLowerCase().endsWith(".war")) {
715
            if (files[i].toLowerCase().endsWith(".war")) {
700
                
716
                
701
                // Calculate the context path and make sure it is unique
717
                // Calculate the context path and make sure it is unique
702
                String contextPath = "/" + files[i];
718
                String contextPath = "/" + files[i].replace( '#', '/' );
703
                int period = contextPath.lastIndexOf(".");
719
                int period = contextPath.lastIndexOf(".");
704
                if (period >= 0)
720
                if (period >= 0)
705
                    contextPath = contextPath.substring(0, period);
721
                    contextPath = contextPath.substring(0, period);

Return to bug 44021