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

(-)test/org/apache/catalina/startup/TestJspServlet.java (+34 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.catalina.startup;
19
20
import java.io.File;
21
22
public class TestJspServlet extends TomcatBaseTest {
23
24
    public void testJspServlet() throws Exception {
25
        Tomcat tomcat = getTomcatInstance();
26
27
        File appDir = 
28
            new File("test/webapp-2.3-jsp-servlet");
29
        // app dir is relative to server home
30
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
31
        
32
        tomcat.start();
33
    }
34
}
0
  + text/plain
35
  + text/plain
1
  + native
36
  + native
(-)test/webapp-2.3-jsp-servlet/WEB-INF/web.xml (-1 / +6 lines)
Lines 29-32 Link Here
29
    specification do not change the behaviour of applications that declared an
29
    specification do not change the behaviour of applications that declared an
30
    earlier version of the specification. 
30
    earlier version of the specification. 
31
  </description>
31
  </description>
32
</web-app>
32
  <servlet>
33
    <servlet-name>ping</servlet-name>
34
    <!-- doesn't have to be here to demonstrate bz 51396 -->
35
    <jsp-file>/ping.jsp</jsp-file>
36
  </servlet>
37
</web-app>
(-)java/org/apache/catalina/startup/ContextConfig.java (-2 / +4 lines)
Lines 1405-1412 Link Here
1405
        }
1405
        }
1406
        servletDef.getParameterMap().put("jspFile", jspFile);
1406
        servletDef.getParameterMap().put("jspFile", jspFile);
1407
        servletDef.setJspFile(null);
1407
        servletDef.setJspFile(null);
1408
        for (Map.Entry<String, String> initParam: jspServletDef.getParameterMap().entrySet()) {
1408
        if (jspServletDef != null) {
1409
            servletDef.addInitParameter(initParam.getKey(), initParam.getValue());
1409
        	for (Map.Entry<String, String> initParam: jspServletDef.getParameterMap().entrySet()) {
1410
        		servletDef.addInitParameter(initParam.getKey(), initParam.getValue());
1411
        	}
1410
        }
1412
        }
1411
    }
1413
    }
1412
1414

Return to bug 51396