Skip to content
Snippets Groups Projects
Commit 9fd83658 authored by Tim Levett's avatar Tim Levett
Browse files

split to multimodule project

parent b9acf5cb
No related branches found
No related tags found
1 merge request!2MUMMNG-2046 : Split into multimodule project so we can overwrite the inherited 404 and 500 page
target
.settings
.project
.classpath
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>edu.wisc.my.app.root</groupId>
<artifactId>root-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>myuw-error-valve</artifactId>
<packaging>jar</packaging>
<name>MyUW ROOT lib</name>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.65</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>code.doit-uw-releases</id>
<url>https://code.doit.wisc.edu/maven/content/repositories/uw-releases/</url>
</repository>
</repositories>
<build>
<finalName>myuw-error-valve</finalName>
</build>
</project>
package edu.wisc.my.root;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
import java.util.Scanner;
import org.apache.catalina.Valve;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.valves.Constants;
import org.apache.catalina.valves.ErrorReportValve;
import org.apache.tomcat.util.res.StringManager;
public class MyUWErrorValve extends ErrorReportValve implements Valve {
private static String ERROR_PAGE_LOCATION="/500.html";
private static String MISSING_PAGE_LOCATION="/404.html";
@Override
protected void report(Request request, Response response, Throwable throwable) {
int statusCode = response.getStatus();
// Do nothing on a 1xx, 2xx and 3xx status
// Do nothing if anything has been written already
// Do nothing if the response hasn't been explicitly marked as in error
// and that error has not been reported.
if (statusCode < 400 || response.getContentWritten() > 0 || !response.setErrorReported()) {
return;
}
try {
if(statusCode > 400 && statusCode < 500)
response.sendRedirect(MISSING_PAGE_LOCATION);
else
response.sendRedirect(ERROR_PAGE_LOCATION);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>edu.wisc.my.app.root</groupId>
<artifactId>root-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ROOT</artifactId>
<packaging>war</packaging>
<name>MyUW ROOT webapp</name>
<url>git@git.doit.wisc.edu:myuw/my-root.git</url>
<repositories>
<repository>
<id>code.doit-uw-releases</id>
<url>https://code.doit.wisc.edu/maven/content/repositories/uw-releases/</url>
</repository>
</repositories>
<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.M2</version>
<configuration>
<webApp>
<baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
<resourcesAsCSV>src/main/webapp,${webapp.target.directory}</resourcesAsCSV>
</baseResource>
</webApp>
</configuration>
</plugin>
</plugins>
</build>
</project>
File moved
File moved
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>MyUW Root</display-name>
<error-page>
<error-code>500</error-code>
<location>/500.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
</web-app>
myuw-root-war/src/main/webapp/favicon.ico

1.37 KiB

myuw-root-war/src/main/webapp/main_logo_w_all.png

8.38 KiB

......@@ -9,34 +9,21 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wisc.my.app.root</groupId>
<artifactId>ROOT</artifactId>
<packaging>war</packaging>
<artifactId>root-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>MyUW ROOT webapp</name>
<name>MyUW ROOT parent</name>
<url>git@git.doit.wisc.edu:myuw/my-root.git</url>
<modules>
<module>myuw-root-jar</module>
<module>myuw-root-war</module>
</modules>
<repositories>
<repository>
<id>code.doit-uw-releases</id>
<url>https://code.doit.wisc.edu/maven/content/repositories/uw-releases/</url>
</repository>
</repositories>
<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.M2</version>
<configuration>
<webApp>
<baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
<resourcesAsCSV>src/main/webapp,${webapp.target.directory}</resourcesAsCSV>
</baseResource>
</webApp>
</configuration>
</plugin>
</plugins>
</build>
</project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment