4010 |
23 Jun 16 |
nicklas |
1 |
<%@ page |
4010 |
23 Jun 16 |
nicklas |
2 |
pageEncoding="UTF-8" |
4010 |
23 Jun 16 |
nicklas |
3 |
session="false" |
4010 |
23 Jun 16 |
nicklas |
4 |
isErrorPage="true" |
4323 |
30 Jan 17 |
nicklas |
5 |
import="net.sf.basedb.core.SessionControl" |
4323 |
30 Jan 17 |
nicklas |
6 |
import="net.sf.basedb.clients.web.Base" |
4010 |
23 Jun 16 |
nicklas |
7 |
import="net.sf.basedb.clients.web.util.HTML" |
4010 |
23 Jun 16 |
nicklas |
8 |
import="net.sf.basedb.core.NotLoggedInException" |
4010 |
23 Jun 16 |
nicklas |
9 |
%> |
4010 |
23 Jun 16 |
nicklas |
10 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4010 |
23 Jun 16 |
nicklas |
11 |
<% |
4010 |
23 Jun 16 |
nicklas |
12 |
// Get the underlying exception |
4010 |
23 Jun 16 |
nicklas |
13 |
Throwable ex = exception; |
4010 |
23 Jun 16 |
nicklas |
14 |
if (ex instanceof org.apache.jasper.JasperException) |
4010 |
23 Jun 16 |
nicklas |
15 |
{ |
4010 |
23 Jun 16 |
nicklas |
16 |
org.apache.jasper.JasperException jex = (org.apache.jasper.JasperException)ex; |
4010 |
23 Jun 16 |
nicklas |
17 |
if (jex.getRootCause() != null) ex = jex.getRootCause(); |
4010 |
23 Jun 16 |
nicklas |
18 |
} |
4010 |
23 Jun 16 |
nicklas |
19 |
String currentPage = (String)request.getAttribute("javax.servlet.error.request_uri"); |
4010 |
23 Jun 16 |
nicklas |
20 |
boolean canRedirectToIndex = currentPage == null || !currentPage.endsWith("delivery/index.jsp"); |
4010 |
23 Jun 16 |
nicklas |
21 |
|
4010 |
23 Jun 16 |
nicklas |
22 |
if (ex instanceof NotLoggedInException && canRedirectToIndex) |
4010 |
23 Jun 16 |
nicklas |
23 |
{ |
4010 |
23 Jun 16 |
nicklas |
24 |
response.sendRedirect("index.jsp"); |
4010 |
23 Jun 16 |
nicklas |
25 |
return; |
4010 |
23 Jun 16 |
nicklas |
26 |
} |
4323 |
30 Jan 17 |
nicklas |
27 |
final SessionControl sc = Base.getSessionControl(request, "net.sf.basedb.reggie.delivery", false); |
4010 |
23 Jun 16 |
nicklas |
28 |
%> |
4323 |
30 Jan 17 |
nicklas |
29 |
<base:page sc="<%=sc%>" type="iframe" noskin="true" title="Ett oväntat fel har inträffat"> |
4010 |
23 Jun 16 |
nicklas |
30 |
<base:head |
4010 |
23 Jun 16 |
nicklas |
31 |
styles="~delivery.css" |
4010 |
23 Jun 16 |
nicklas |
32 |
> |
4010 |
23 Jun 16 |
nicklas |
33 |
<style> |
4010 |
23 Jun 16 |
nicklas |
34 |
.content |
4010 |
23 Jun 16 |
nicklas |
35 |
{ |
4010 |
23 Jun 16 |
nicklas |
36 |
font-size: 1.5rem; |
4010 |
23 Jun 16 |
nicklas |
37 |
margin: 1rem 2rem; |
4010 |
23 Jun 16 |
nicklas |
38 |
border-width: 2px; |
4010 |
23 Jun 16 |
nicklas |
39 |
border-radius: 0.5rem 0.5rem; |
4010 |
23 Jun 16 |
nicklas |
40 |
text-align: center; |
4010 |
23 Jun 16 |
nicklas |
41 |
} |
4010 |
23 Jun 16 |
nicklas |
42 |
|
4010 |
23 Jun 16 |
nicklas |
43 |
h1 |
4010 |
23 Jun 16 |
nicklas |
44 |
{ |
4010 |
23 Jun 16 |
nicklas |
45 |
background-color: #E8E8E8; |
4010 |
23 Jun 16 |
nicklas |
46 |
border-bottom-width: 2px; |
4010 |
23 Jun 16 |
nicklas |
47 |
font-size: 2rem; |
4010 |
23 Jun 16 |
nicklas |
48 |
color: #000000; |
4010 |
23 Jun 16 |
nicklas |
49 |
padding: 0.5rem 1.5rem; |
4010 |
23 Jun 16 |
nicklas |
50 |
border-radius: 0.25rem 0.25rem 0 0; |
4010 |
23 Jun 16 |
nicklas |
51 |
} |
4010 |
23 Jun 16 |
nicklas |
52 |
|
4010 |
23 Jun 16 |
nicklas |
53 |
.error-text |
4010 |
23 Jun 16 |
nicklas |
54 |
{ |
4010 |
23 Jun 16 |
nicklas |
55 |
margin: 1rem; |
4010 |
23 Jun 16 |
nicklas |
56 |
font-size: 1.25rem; |
4010 |
23 Jun 16 |
nicklas |
57 |
color: #C80000; |
4010 |
23 Jun 16 |
nicklas |
58 |
} |
4010 |
23 Jun 16 |
nicklas |
59 |
</style> |
4010 |
23 Jun 16 |
nicklas |
60 |
</base:head> |
4010 |
23 Jun 16 |
nicklas |
61 |
|
4010 |
23 Jun 16 |
nicklas |
62 |
<base:body> |
4010 |
23 Jun 16 |
nicklas |
63 |
<div class="content"> |
4010 |
23 Jun 16 |
nicklas |
64 |
<h1>Ett oväntat fel har inträffat</h1> |
4010 |
23 Jun 16 |
nicklas |
65 |
<div class="error-text"> |
4010 |
23 Jun 16 |
nicklas |
66 |
<%=HTML.encodeTags(ex.getMessage()) %> |
4010 |
23 Jun 16 |
nicklas |
67 |
</div> |
4010 |
23 Jun 16 |
nicklas |
68 |
</div> |
4010 |
23 Jun 16 |
nicklas |
69 |
</base:body> |
4010 |
23 Jun 16 |
nicklas |
70 |
</base:page> |