Skip to content
Snippets Groups Projects
Commit 8fc63a36 authored by Doug Reed's avatar Doug Reed
Browse files

MUMUP-2451 New 403 Error message

parent 697480d1
No related branches found
No related tags found
1 merge request!7MUMUP-2451 Graceful Exclusive Rendering on Authentication Error
......@@ -12,6 +12,7 @@ import org.apache.catalina.valves.ErrorReportValve;
public class MyUWErrorValve extends ErrorReportValve implements Valve {
private static String ERROR_PAGE_LOCATION="/500.html";
private static String AUTHORIZATION_ERROR_LOCATION="/403.html";
private static String MISSING_PAGE_LOCATION="/404.html";
@Override
......@@ -28,11 +29,17 @@ public class MyUWErrorValve extends ErrorReportValve implements Valve {
final String page;
InputStream in = null;
try {
if(statusCode > 400 && statusCode < 500) {
page = MISSING_PAGE_LOCATION;
} else {
page = ERROR_PAGE_LOCATION;
switch(statusCode){
case 403:
page = AUTHORIZATION_ERROR_LOCATION;
break;
case 404:
page=MISSING_PAGE_LOCATION;
break;
default:
page=ERROR_PAGE_LOCATION;
}
try {
in = MyUWErrorValve.class.getResourceAsStream(page);
if(in == null) {
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>MyUW Page Not Found</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<style>
a {
color:#b70101;
}
a:hover {
color:#660000;
}
p.apologize {
text-align:center;
padding:20px 0px 50px;
}
.header {
background-color:#b70101;
text-align:center;
padding:10px;
height:53px;
}
.header h1 {
font-size:2.3em;
font-weight:100;
color:#fff;
text-align:center;
margin-top:0px;
white-space:nowrap;
}
.header h2 {
color:#fff;
text-align:left;
font-size:1.8em;
font-weight:200;
margin:2px 0px 0px 30px;
padding:0;
white-space:nowrap;
}
.header div {
display:inline;
}
.main-content {
text-align:center;
padding-top:30px;
}
.main-content p {
font-size:1.2em;
padding:10px 0px;
}
.main-content strong {
font-size:1.7em;
font-weight:200;
text-align:center;
}
.service {
width:35%;
}
.crest {
display:block;
position:absolute;
width:200px;
z-index:5;
overflow:hidden;
}
.madison {
text-align: center;
margin:30px 0px 15px
}
@media (max-width:768px) {
.main-content strong {
font-size:1.55em;
}
.main-content p {
font-size:1.1em;
}
.header h1 {
font-size:1.8em;
margin:3px -50% 0px;
white-space:no-wrap;
}
.header h2 {
font-size:1.3em;
margin-top:7px;
}
.outage-title {
padding:0 -50%;
}
}
@media (max-width:500px) {
.header h1 {
margin:3px 0px 0px;
}
}
</style>
</head>
<body>
<div id="row">
<div class="col-xs-12 header">
<div class="col-xs-4 col-sm-4 photo-div">
<img src="/main_logo_w_all.png" class="crest">
</div>
<div class="col-xs-4 outage-title">
<h1>Access Denied</h1>
</div>
<div class="col-sm-4">
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 main-content">
<p><strong>Sorry, you're not authorized to access this.</p>
<br><br>
<i class='fa fa-exclamation-triangle fa-5x'></i>
<p>If you're here by accident, head back to your My-UW <a href='/web'>homepage</a>.</p>
<p>For help with authorization, contact the DoIT <a href="https://kb.wisc.edu/helpdesk/"></a>Help Desk</a></p>
</div>
</div>
</div>
</body>
</html>
......@@ -4,7 +4,11 @@
<web-app>
<display-name>MyUW Root</display-name>
<error-page>
<error-code>403</error-code>
<location>/403.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.html</location>
......
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