211 |
22 Mar 05 |
nicklas |
1 |
<%-- $Id$ |
211 |
22 Mar 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Nicklas Nordborg |
211 |
22 Mar 05 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
211 |
22 Mar 05 |
nicklas |
9 |
|
211 |
22 Mar 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
211 |
22 Mar 05 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
211 |
22 Mar 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
211 |
22 Mar 05 |
nicklas |
14 |
|
211 |
22 Mar 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
211 |
22 Mar 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
211 |
22 Mar 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
211 |
22 Mar 05 |
nicklas |
18 |
GNU General Public License for more details. |
211 |
22 Mar 05 |
nicklas |
19 |
|
211 |
22 Mar 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
211 |
22 Mar 05 |
nicklas |
22 |
------------------------------------------------------------------ |
211 |
22 Mar 05 |
nicklas |
23 |
|
211 |
22 Mar 05 |
nicklas |
24 |
This page is used to catch PermissionDeniedExceptions which are |
211 |
22 Mar 05 |
nicklas |
25 |
directed here via the exception.jsp page. PermissionDeniedExceptions |
211 |
22 Mar 05 |
nicklas |
26 |
happen when a user tries to access a protected page without the proper |
211 |
22 Mar 05 |
nicklas |
27 |
permission. Typically the exception is thrown from the method that |
211 |
22 Mar 05 |
nicklas |
28 |
retrieves the BaseControl object: |
211 |
22 Mar 05 |
nicklas |
29 |
|
211 |
22 Mar 05 |
nicklas |
30 |
BASE.getExistingBaseControl(pageContext, permission, item_type); |
211 |
22 Mar 05 |
nicklas |
31 |
|
211 |
22 Mar 05 |
nicklas |
32 |
The exception is also thrown if trying to manipulate an item without |
211 |
22 Mar 05 |
nicklas |
33 |
the proper permission, but normally such conditions should not happen |
211 |
22 Mar 05 |
nicklas |
34 |
if the interface behaves corretly (ie. no "Edit item" link is displayed |
211 |
22 Mar 05 |
nicklas |
35 |
unless the user has the permission). |
211 |
22 Mar 05 |
nicklas |
36 |
|
211 |
22 Mar 05 |
nicklas |
37 |
@author Nicklas |
211 |
22 Mar 05 |
nicklas |
38 |
@version 2.0 |
211 |
22 Mar 05 |
nicklas |
39 |
--%> |
5426 |
24 Sep 10 |
nicklas |
40 |
<%@ page pageEncoding="UTF-8" session="false" |
211 |
22 Mar 05 |
nicklas |
41 |
isErrorPage="true" |
211 |
22 Mar 05 |
nicklas |
42 |
%> |
211 |
22 Mar 05 |
nicklas |
43 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" |
211 |
22 Mar 05 |
nicklas |
44 |
%> |
211 |
22 Mar 05 |
nicklas |
45 |
<% |
3504 |
15 Jun 07 |
nicklas |
46 |
Throwable t = exception; |
3504 |
15 Jun 07 |
nicklas |
47 |
//t is either a JasperException, a ServletException or a WebException; see exception.jsp |
3504 |
15 Jun 07 |
nicklas |
48 |
if (t instanceof org.apache.jasper.JasperException) |
3504 |
15 Jun 07 |
nicklas |
49 |
{ |
3504 |
15 Jun 07 |
nicklas |
50 |
t = ((org.apache.jasper.JasperException)t).getRootCause(); |
3504 |
15 Jun 07 |
nicklas |
51 |
} |
3504 |
15 Jun 07 |
nicklas |
52 |
if (t instanceof ServletException) |
3504 |
15 Jun 07 |
nicklas |
53 |
{ |
3504 |
15 Jun 07 |
nicklas |
54 |
t = ((ServletException)t).getRootCause(); |
3504 |
15 Jun 07 |
nicklas |
55 |
// t should now be an PermissionDeniedException |
3504 |
15 Jun 07 |
nicklas |
56 |
} |
3504 |
15 Jun 07 |
nicklas |
57 |
Throwable ex = t; |
5956 |
13 Feb 12 |
nicklas |
58 |
String exceptionClassName = ex.getClass().getName().replaceAll("net.sf.basedb.core.", ""); |
5956 |
13 Feb 12 |
nicklas |
59 |
|
211 |
22 Mar 05 |
nicklas |
60 |
%> |
463 |
26 Apr 05 |
nicklas |
61 |
<base:page type="default" menu="exception" title="Permission denied"> |
5956 |
13 Feb 12 |
nicklas |
62 |
<base:head scripts="exception.js" styles="popup.css"/> |
6309 |
21 Aug 13 |
nicklas |
63 |
<base:body> |
5956 |
13 Feb 12 |
nicklas |
64 |
<h1><%=exceptionClassName + " on page "+request.getAttribute("javax.servlet.error.request_uri")%></h1> |
211 |
22 Mar 05 |
nicklas |
65 |
|
6610 |
20 Nov 14 |
nicklas |
66 |
<div class="content bg-filled-50 bottomborder"> |
6610 |
20 Nov 14 |
nicklas |
67 |
<table style="margin: auto; height: 100%;"> |
6610 |
20 Nov 14 |
nicklas |
68 |
<tr><td> |
6610 |
20 Nov 14 |
nicklas |
69 |
<div class="messagecontainer error"> |
5956 |
13 Feb 12 |
nicklas |
70 |
<%=ex.getMessage()%> |
6610 |
20 Nov 14 |
nicklas |
71 |
</div> |
6610 |
20 Nov 14 |
nicklas |
72 |
</td></tr> |
6610 |
20 Nov 14 |
nicklas |
73 |
</table> |
5956 |
13 Feb 12 |
nicklas |
74 |
</div> |
463 |
26 Apr 05 |
nicklas |
75 |
|
5956 |
13 Feb 12 |
nicklas |
76 |
<base:buttongroup subclass="dialogbuttons"> |
6309 |
21 Aug 13 |
nicklas |
77 |
<base:button id="goback" title="Back" /> |
6309 |
21 Aug 13 |
nicklas |
78 |
<base:button id="close" title="Close" /> |
5956 |
13 Feb 12 |
nicklas |
79 |
</base:buttongroup> |
522 |
04 May 05 |
nicklas |
80 |
|
463 |
26 Apr 05 |
nicklas |
81 |
</base:body> |
211 |
22 Mar 05 |
nicklas |
82 |
</base:page> |
211 |
22 Mar 05 |
nicklas |
83 |
|