~ubuntu-branches/ubuntu/natty/tomcat6/natty-proposed

« back to all changes in this revision

Viewing changes to java/org/apache/catalina/servlets/DefaultServlet.java

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2010-05-21 13:51:15 UTC
  • mfrom: (2.2.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100521135115-qfwnf24lzvi3644v
Tags: 6.0.26-2
* debian/tomcat6.{postinst,prerm}: Respect TOMCAT6_USER and TOMCAT6_GROUP
  as defined in /etc/default/tomcat6 when setting directory permissions and
  authbind configuration (Closes: #581018, LP: #557300)
* debian/tomcat6.postinst: Use group "tomcat6" instead of "adm" for
  permissions in /var/lib/tomcat6, so that group "adm" doesn't get write
  permissions over /var/lib/tomcat6/webapps (LP: #569118)

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 *
74
74
 * @author Craig R. McClanahan
75
75
 * @author Remy Maucherat
76
 
 * @version $Revision: 762909 $ $Date: 2009-04-07 21:12:35 +0200 (Di, 07. Apr 2009) $
 
76
 * @version $Revision: 915605 $ $Date: 2010-02-24 01:10:45 +0100 (Mi, 24. Feb 2010) $
77
77
 */
78
78
 
79
79
public class DefaultServlet
121
121
    /**
122
122
     * Allow customized directory listing per directory.
123
123
     */
124
 
    protected String  localXsltFile = null;
125
 
 
126
 
 
 
124
    protected String localXsltFile = null;
 
125
 
 
126
 
 
127
    /**
 
128
     * Allow customized directory listing per context.
 
129
     */
 
130
    protected String contextXsltFile = null;
 
131
    
 
132
    
127
133
    /**
128
134
     * Allow customized directory listing per instance.
129
135
     */
130
 
    protected String  globalXsltFile = null;
 
136
    protected String globalXsltFile = null;
131
137
 
132
138
 
133
139
    /**
242
248
        fileEncoding = getServletConfig().getInitParameter("fileEncoding");
243
249
 
244
250
        globalXsltFile = getServletConfig().getInitParameter("globalXsltFile");
 
251
        contextXsltFile = getServletConfig().getInitParameter("contextXsltFile");
245
252
        localXsltFile = getServletConfig().getInitParameter("localXsltFile");
246
253
        readmeFile = getServletConfig().getInitParameter("readmeFile");
247
254
 
686
693
                // to be ignored by the resource that is including us.
687
694
                // Therefore, the only way we can let the including resource
688
695
                // know is by including warning message in response
689
 
                response.getWriter().write(
 
696
                response.getWriter().write(RequestUtil.filter(
690
697
                    sm.getString("defaultServlet.missingResource",
691
 
                    requestUri));
 
698
                    requestUri)));
692
699
            }
693
700
 
694
701
            response.sendError(HttpServletResponse.SC_NOT_FOUND,
1182
1189
                    trimmed.equalsIgnoreCase(localXsltFile))
1183
1190
                    continue;
1184
1191
 
 
1192
                if ((cacheEntry.name + trimmed).equals(contextXsltFile))
 
1193
                    continue;
 
1194
 
1185
1195
                CacheEntry childCacheEntry =
1186
1196
                    resources.lookupCache(cacheEntry.name + resourceName);
1187
1197
                if (!childCacheEntry.exists) {
1478
1488
            } catch (NamingException e) {
1479
1489
                if (debug > 10)
1480
1490
                    log("localXsltFile '" + localXsltFile + "' not found", e);
1481
 
 
1482
 
                return null;
1483
1491
            }
1484
1492
        }
1485
1493
 
 
1494
        if (contextXsltFile != null) {
 
1495
            InputStream is =
 
1496
                getServletContext().getResourceAsStream(contextXsltFile);
 
1497
            if (is != null)
 
1498
                return is;
 
1499
 
 
1500
            if (debug > 10)
 
1501
                log("contextXsltFile '" + contextXsltFile + "' not found");
 
1502
        }
 
1503
 
1486
1504
        /*  Open and read in file in one fell swoop to reduce chance
1487
1505
         *  chance of leaving handle open.
1488
1506
         */