1
1
/*
2
2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
3
*
4
- * Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved.
4
+ * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved.
5
5
*
6
6
* The contents of this file are subject to the terms of either the GNU
7
7
* General Public License Version 2 only ("GPL") or the Common Development
@@ -457,7 +457,7 @@ public void addWrapper(String hostName, String contextPath, String path,
457
457
* @param contextPath Context path this wrapper belongs to
458
458
* @param path Wrapper mapping
459
459
* @param wrapper Wrapper object
460
- * @param jspWildCard
460
+ * @param jspWildCard jsp wildcard
461
461
*/
462
462
public void addWrapper (String hostName , String contextPath , String path ,
463
463
Object wrapper , boolean jspWildCard ) {
@@ -471,7 +471,7 @@ public void addWrapper(String hostName, String contextPath, String path,
471
471
* @param contextPath Context path this wrapper belongs to
472
472
* @param path Wrapper mapping
473
473
* @param wrapper Wrapper object
474
- * @param jspWildCard
474
+ * @param jspWildCard jsp wildcard
475
475
* @param servletName servlet name or null if unknown
476
476
*/
477
477
public void addWrapper (String hostName , String contextPath , String path ,
@@ -1042,7 +1042,7 @@ private void internalMap(CharChunk host, CharChunk uri,
1042
1042
boolean found = false;
1043
1043
*/
1044
1044
while (pos >= 0 ) {
1045
- if (uri .startsWith (contexts [pos ].name )) {
1045
+ if (contexts != null && uri .startsWith (contexts [pos ].name )) {
1046
1046
length = contexts [pos ].name .length ();
1047
1047
if (uri .getLength () == length ) {
1048
1048
found = true ;
@@ -1063,7 +1063,7 @@ private void internalMap(CharChunk host, CharChunk uri,
1063
1063
uri .setEnd (uriEnd );
1064
1064
1065
1065
if (!found ) {
1066
- if ("" .equals (contexts [0 ].name )) {
1066
+ if (contexts != null && "" .equals (contexts [0 ].name )) {
1067
1067
ctx = contexts [0 ];
1068
1068
// START GlassFish 1024
1069
1069
} else if (hosts [hostPos ].defaultContexts [0 ] != null ) {
@@ -1129,6 +1129,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1129
1129
mappingData .requestPath .setString ("" );
1130
1130
mappingData .wrapperPath .setString ("" );
1131
1131
mappingData .pathInfo .setString ("/" );
1132
+ mappingData .mappingType = MappingData .CONTEXT_ROOT ;
1132
1133
}
1133
1134
}
1134
1135
@@ -1272,6 +1273,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1272
1273
path .getEnd ());
1273
1274
mappingData .requestPath .setString (pathStr );
1274
1275
mappingData .wrapperPath .setString (pathStr );
1276
+ mappingData .mappingType = MappingData .DEFAULT ;
1275
1277
}
1276
1278
}
1277
1279
}
@@ -1326,6 +1328,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1326
1328
(path .getBuffer (), path .getStart (), path .getEnd ());
1327
1329
mappingData .wrapperPath .setChars
1328
1330
(path .getBuffer (), path .getStart (), path .getEnd ());
1331
+ mappingData .mappingType = MappingData .DEFAULT ;
1329
1332
}
1330
1333
// Redirection to a folder
1331
1334
char [] buf = path .getBuffer ();
@@ -1392,6 +1395,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1392
1395
mappingData .wrapperPath .setString (wrappers [pos ].name );
1393
1396
mappingData .wrapper = wrappers [pos ].object ;
1394
1397
mappingData .servletName = wrappers [pos ].servletName ;
1398
+ mappingData .mappingType = MappingData .EXACT ;
1395
1399
}
1396
1400
}
1397
1401
@@ -1443,6 +1447,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1443
1447
mappingData .wrapper = wrappers [pos ].object ;
1444
1448
mappingData .servletName = wrappers [pos ].servletName ;
1445
1449
mappingData .jspWildCard = wrappers [pos ].jspWildCard ;
1450
+ mappingData .mappingType = MappingData .PATH ;
1446
1451
}
1447
1452
}
1448
1453
}
@@ -1483,6 +1488,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1483
1488
(buf , servletPath , pathEnd );
1484
1489
mappingData .wrapper = wrappers [pos ].object ;
1485
1490
mappingData .servletName = wrappers [pos ].servletName ;
1491
+ mappingData .mappingType = MappingData .EXTENSION ;
1486
1492
}
1487
1493
path .setStart (servletPath );
1488
1494
path .setEnd (pathEnd );
@@ -1492,7 +1498,7 @@ private void internalMapWrapper(Context context, CharChunk path,
1492
1498
1493
1499
1494
1500
/**
1495
- * Find a map elemnt given its name in a sorted array of map elements.
1501
+ * Find a map element given its name in a sorted array of map elements.
1496
1502
* This will return the index for the closest inferior or equal item in the
1497
1503
* given array.
1498
1504
*/
@@ -1502,7 +1508,7 @@ private static int find(MapElement[] map, CharChunk name) {
1502
1508
1503
1509
1504
1510
/**
1505
- * Find a map elemnt given its name in a sorted array of map elements.
1511
+ * Find a map element given its name in a sorted array of map elements.
1506
1512
* This will return the index for the closest inferior or equal item in the
1507
1513
* given array.
1508
1514
*/
@@ -1547,11 +1553,11 @@ private static int find(MapElement[] map, CharChunk name,
1547
1553
}
1548
1554
1549
1555
1550
- /**
1551
- * Find a map element given its name in a sorted array of map elements.
1552
- * This will return the index for the closest inferior or equal item in the
1553
- * given array.
1554
- */
1556
+ // /**
1557
+ // * Find a map element given its name in a sorted array of map elements.
1558
+ // * This will return the index for the closest inferior or equal item in the
1559
+ // * given array.
1560
+ // */
1555
1561
// private static int findIgnoreCase(MapElement[] map, String name) {
1556
1562
// CharChunk cc = new CharChunk();
1557
1563
// char[] chars = name.toCharArray();
0 commit comments