Debian Codegraph @

jetty-ee9/jetty-ee9-glassfish-jstl/src/test/java/org/eclipse/jetty/ee9/jstl/JspConfig.java

raw
1 //
2 // ========================================================================
3 // Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
4 //
5 // This program and the accompanying materials are made available under the
6 // terms of the Eclipse Public License v. 2.0 which is available at
7 // https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
8 // which is available at https://www.apache.org/licenses/LICENSE-2.0.
9 //
10 // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
11 // ========================================================================
12 //
13
14 package org.eclipse.jetty.ee9.jstl;
15
16 import java.io.File;
17 import java.net.URI;
18
19 import jakarta.servlet.ServletContext;
20 import org.eclipse.jetty.ee9.webapp.WebAppContext;
21
22 /**
23 * Attempt at collecting up all of the JSP specific configuration bits and pieces into a single place
24 * for WebAppContext users to utilize.
25 */
26 public class JspConfig
27 {
28 public static void init(WebAppContext context, URI baseUri, File scratchDir)
29 {
30 context.setAttribute(ServletContext.TEMPDIR, scratchDir);
31 context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
32 System.getProperty("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"));
33 context.setWar(baseUri.toASCIIString());
34 context.setResourceBase(baseUri.toASCIIString());
35 }
36 }