Skip to content

Commit 96658bb

Browse files
committed
re-enable jsp pre-compilation
jsp pre-compilation was a non-issue after "parameterized context path" change. so we can revert back.
1 parent 39f8d1b commit 96658bb

2 files changed

Lines changed: 21 additions & 43 deletions

File tree

pom.xml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
<directory>src/main/resources</directory>
7171
<filtering>false</filtering>
7272
<includes>
73-
<include>webapp/**</include>
73+
<include>webapp/static/**</include>
74+
<include>webapp/WEB-INF/web.xml</include>
7475
</includes>
7576
</resource>
7677
</resources>
@@ -197,25 +198,25 @@
197198
</plugin>
198199

199200
<!-- Pre-compiles JSPs -->
200-
<!--<plugin>-->
201-
<!--<groupId>org.eclipse.jetty</groupId>-->
202-
<!--<artifactId>jetty-jspc-maven-plugin</artifactId>-->
203-
<!--<version>${jetty.version}</version>-->
204-
<!--<executions>-->
205-
<!--<execution>-->
206-
<!--<phase>compile</phase>-->
207-
<!--<id>jspc</id>-->
208-
<!--<goals>-->
209-
<!--<goal>jspc</goal>-->
210-
<!--</goals>-->
211-
<!--<configuration>-->
212-
<!--<webAppSourceDirectory>${basedir}/src/main/resources/webapp</webAppSourceDirectory>-->
213-
<!--<webXml>${basedir}/src/main/resources/webapp/WEB-INF/web.xml</webXml>-->
214-
<!--<webXmlFragment>${basedir}/target/classes/webapp/WEB-INF/web.xml-frag</webXmlFragment>-->
215-
<!--</configuration>-->
216-
<!--</execution>-->
217-
<!--</executions>-->
218-
<!--</plugin>-->
201+
<plugin>
202+
<groupId>org.eclipse.jetty</groupId>
203+
<artifactId>jetty-jspc-maven-plugin</artifactId>
204+
<version>${jetty.version}</version>
205+
<executions>
206+
<execution>
207+
<phase>compile</phase>
208+
<id>jspc</id>
209+
<goals>
210+
<goal>jspc</goal>
211+
</goals>
212+
<configuration>
213+
<webAppSourceDirectory>${basedir}/src/main/resources/webapp</webAppSourceDirectory>
214+
<webXml>${basedir}/src/main/resources/webapp/WEB-INF/web.xml</webXml>
215+
<webXmlFragment>${basedir}/target/classes/webapp/WEB-INF/web.xml-frag</webXmlFragment>
216+
</configuration>
217+
</execution>
218+
</executions>
219+
</plugin>
219220

220221
<plugin>
221222
<groupId>org.apache.cxf</groupId>

src/main/java/de/rwth/idsg/steve/SteveAppContext.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import javax.servlet.DispatcherType;
2626
import javax.servlet.Filter;
27-
import java.io.File;
2827
import java.io.IOException;
2928
import java.util.ArrayList;
3029
import java.util.EnumSet;
@@ -144,33 +143,11 @@ private Handler getRedirectHandler() {
144143
// -------------------------------------------------------------------------
145144

146145
private void initJSP(WebAppContext ctx) throws IOException {
147-
ctx.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
148-
".*/[^/]*servlet-api-[^/]*\\.jar$"
149-
+ "|.*/javax.servlet.jsp.jstl-.*\\.jar$"
150-
+ "|.*/spring-webmvc.*\\.jar$"
151-
+ "|.*/.*taglibs.*\\.jar$");
152-
153-
ctx.setAttribute("javax.servlet.context.tempdir", getScratchDir());
154146
ctx.setAttribute("org.eclipse.jetty.containerInitializers", jspInitializers());
155147
ctx.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());
156148
ctx.addBean(new ServletContainerInitializersStarter(ctx), true);
157149
}
158150

159-
/**
160-
* Establish Scratch directory for the servlet context (used by JSP compilation)
161-
*/
162-
private File getScratchDir() throws IOException {
163-
File tempDir = new File(System.getProperty("java.io.tmpdir"));
164-
File scratchDir = new File(tempDir.toString(), "steve-jetty-jsp");
165-
166-
if (!scratchDir.exists()) {
167-
if (!scratchDir.mkdirs()) {
168-
throw new IOException("Unable to create scratch directory: " + scratchDir);
169-
}
170-
}
171-
return scratchDir;
172-
}
173-
174151
/**
175152
* Ensure the JSP engine is initialized correctly
176153
*/

0 commit comments

Comments
 (0)