source: main/branches/2.1/src/main/webapps/ibisph-view/WEB-INF/jsp/error/detail.jsp @ 3544

Last change on this file since 3544 was 3544, checked in by Garth Braithwaite, 11 years ago

view and java - temp save before changing secure query UI direction

File size: 6.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
3<%--
4        JSP used to display standard HTTP and caught Spring MVC errors.  HTTP errors
5        are configured to use this page in the web.xml file.  They should use an HTTP
6        get query string parameter named "message" that contains the message to be
7        displayed to the user.  MVC errors are configured within the Spring Bean
8        setup and ExceptionHandler java code. 
9
10        isErrorPage="true" causes the Web container to define a new implicit variable
11        named: "exception".
12
13        Expressions: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
14--%>
15
16<%@ page language="java"%>
17<%@ page isErrorPage="true"%>
18<%@ page isELIgnored="false"%>
19<%@ include file="../_taglibs.jsp"%>
20
21<c:set var="pageTitle" value="IBIS-PH Application Error"/>
22
23<%
24String errorMessage = request.getParameter("message");
25if(errorMessage == null) errorMessage = (String)request.getSession().getAttribute("javax.servlet.error.message");
26if(errorMessage == null) errorMessage = (String)request.getAttribute("javax.servlet.error.message");
27if(errorMessage == null) errorMessage = "Could not get error message.";
28
29String errorURI = request.getParameter("uri");
30if(errorURI == null) errorURI = (String)request.getSession().getAttribute ("javax.servlet.error.request_uri");
31if(errorURI == null) errorURI = (String)request.getAttribute("javax.servlet.error.request_uri");
32if(errorURI == null) errorMessage = "Could not get error URI.";
33
34String statusCode = ((Integer)request.getAttribute("javax.servlet.error.status_code")).toString();
35if(statusCode == null) statusCode = "unknown";
36
37/*
38        Logging flag is set via the logging execption handler which may or may not
39        be used.  Even when used most of the time the error is still not caught in
40        the Spring MVC framework as it is "view" related and does not manifest itself
41        until the output stream has been opended with the view being streamed back.
42*/
43boolean wasExceptionLogged = (request.getAttribute("ErrorLoggedFlag") != null);
44if(!wasExceptionLogged) {
45        org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger("error/detail.jsp");
46        logger.error(
47                " Error - Code: " + statusCode
48                + ", URI: " + errorURI
49                + ", Message: " + errorMessage
50                + ", Requester's IP: " + request.getRemoteAddr() 
51                , exception
52        );
53}
54
55// always return a 404 regardless of the actual error.  This is for crawlers...
56try { 
57        response.setStatus(404); 
58}
59catch(Exception e) {
60        System.out.println("jsp/ErrorPage.jsp - Internal Error Setting Status Code, Exception: "+e);
61}
62%>
63
64
65<html lang="en">
66
67        <head>
68
69<%@ include file="_head.jsp"%>
70
71                <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/ModalDialog.css"/>
72               
73                <script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/DocumentSize.js"></script>
74                <script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/ModalDialog.js"></script>
75                <script type="text/javascript">
76                        window.onLoadEventManager.add(initializePage);
77
78                        var modalDialog = null;
79                        function initializePage()
80                        {
81                                modalDialog = new ModalDialog("modalDialog", "modalDialogContentContainer");
82                        }
83                </script>
84        </head>
85
86        <body><div id="page">
87
88<%@ include file="_header.jsp"%>
89
90                <div id="content" class="Error"><div class="Section">
91                        <div class="Header">
92                                <h1 title="HTTP Status Code: <%=statusCode%>">Error <%=statusCode%>: <%=errorMessage%></h1>
93                        </div>
94
95                        <div class="Content">
96                                <div class="Request">
97                                        The IBIS-PH system has experienced an internal error while trying to fulfill a request for:<br/>
98                                        <a href="<%=errorURI%>"><%=errorURI%></a>
99                                </div><br/>
100
101<%@ include file="_options.jsp"%>
102
103                        </div>
104                        <div class="Footer"></div>
105
106                        <a href="javascript:modalDialog.show()" title="Show Debugging Information" class="ShowDebug">Debug Info</a>
107
108<div id="modalDialog" class="ModalDialog">
109        <a href="javascript:modalDialog.hide()" title="Close" class="CloseBox"><img src="${pageContext.request.contextPath}/image/closebox.png"/></a>
110        <div class="InnerCanvas">
111                <h2 class="TitleBar" style="margin-left: 0;">Detailed Debugging Information</h2>
112                <div id="modalDialogContentContainer">
113                        <table class="Info">
114                                <tr class="Section"><th colspan="2">HTTP Error:</th></tr>
115                                <tr>
116                                        <th class="Section">Status Code</th>
117                                        <td><%=statusCode%></td>
118                                </tr>
119                                <tr>
120                                        <th class="Section">Problem URI</th>
121                                        <td><%=errorURI%></td>
122                                </tr>
123                                <tr>
124                                        <th class="Section">Message</th>
125                                        <td><%=errorMessage%></td>
126                                </tr>
127
128<%if(exception != null) { %>
129                                <tr class="Section"><th colspan="2">Exception Information:</th></tr>
130                                <tr>
131                                        <th class="Section">Type</th>
132                                        <td>${requestScope["javax.servlet.error.exception_type"]}</td>
133                                </tr>
134                                <tr>
135                                        <th class="Section">Localized Message</th>
136                                        <td><%=exception.getLocalizedMessage()%></td>
137                                </tr>
138                                <tr>
139                                        <th class="Section">Stack Trace</th>
140                                        <td><textarea rows="10" cols="90" wrap="off"><%exception.printStackTrace(new java.io.PrintWriter((java.io.Writer)out));%></textarea></td>
141                                </tr>
142<%}%>
143
144                                <tr class="Section"><th colspan="2">Request Information:</th></tr>
145                                <tr>
146                                        <th  class="Section">Remote Host</th>
147                                        <td>${pageContext.request.remoteHost}</td>
148                                </tr>
149                                <tr>
150                                        <th  class="Section">Remote Addr</th>
151                                        <td>${pageContext.request.remoteAddr}</td>
152                                </tr>
153                                <tr>
154                                        <th  class="Section">Local Addr</th>
155                                        <td>${pageContext.request.localAddr}</td>
156                                </tr>
157                                <tr>
158                                        <th  class="Section">Remote User</th>
159                                        <td>${pageContext.request.remoteUser}</td>
160                                </tr>
161                                <tr>
162                                        <th  class="Section">Web Scheme</th>
163                                        <td>${pageContext.request.scheme}</td>
164                                </tr>
165                                <tr>
166                                        <th  class="Section">Protocol</th>
167                                        <td>${pageContext.request.protocol}</td>
168                                </tr>
169                                <tr>
170                                        <th  class="Section">Content Type</th>
171                                        <td>${pageContext.request.contentType}</td>
172                                </tr>
173                                <tr>
174                                        <th class="Section">Request Context Path</th>
175                                        <td>${pageContext.request.contextPath}</td>
176                                </tr>
177                                <tr>
178                                        <th  class="Section">Request Locale</th>
179                                        <td>${pageContext.request.locale}</td>
180                                </tr>
181                                <tr>
182                                        <th  class="Section">Authorization Type</th>
183                                        <td>${pageContext.request.authType}</td>
184                                </tr>
185                                <tr>
186                                        <th  class="Section">Character Encoding</th>
187                                        <td>${pageContext.request.characterEncoding}</td>
188                                </tr>
189               
190                                <tr class="Section"><th colspan="2">HTTP Headers:</th></tr>
191<c:forEach items='${header}' var='h'>
192                                <tr>
193                                        <th  class="Section">${h.key}</th>
194                                        <td>${h.value}</td>
195                                </tr>
196</c:forEach>
197                        </table>
198
199                </div>
200        </div>
201</div>
202
203                </div></div>
204
205<%@ include file="_footer.jsp"%>
206
207        </div></body>
208</html>
209
Note: See TracBrowser for help on using the repository browser.