Debian Codegraph @

jetty-ee10/jetty-ee10-glassfish-jstl/src/test/java/org/eclipse/jetty/ee10/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.ee10.jstl;
15
16 import java.io.File;
17 import java.net.URI;
18 import java.nio.file.Path;
19
20 import jakarta.servlet.ServletContext;
21 import org.eclipse.jetty.ee10.webapp.WebAppContext;
22
23 /**
24 * Attempt at collecting up all of the JSP specific configuration bits and pieces into a single place
25 * for WebAppContext users to utilize.
26 */
27 public class JspConfig
28 {
29 public static void init(WebAppContext context, URI baseUri, File scratchDir)
30 {
31 context.setAttribute(ServletContext.TEMPDIR, scratchDir);
32 context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
33 ".*/jetty-jakarta-servlet-api-[^/]*\\.jar$|.*jakarta.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard.*\\.jar");
34 context.setWar(baseUri.toASCIIString());
35 context.setBaseResourceAsPath(Path.of(baseUri));
36 }
37 }