error.jsp 1.58 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5 6 7 8
<%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
--%>

<%@ page import="java.io.*,
                 org.jivesoftware.util.ParamUtils,
9
                 org.jivesoftware.util.JiveGlobals,
Matt Tucker's avatar
Matt Tucker committed
10 11
                 org.jivesoftware.messenger.auth.UnauthorizedException,
                 org.jivesoftware.messenger.user.UserNotFoundException,
Matt Tucker's avatar
Matt Tucker committed
12
                 org.jivesoftware.messenger.group.GroupNotFoundException"
Matt Tucker's avatar
Matt Tucker committed
13 14
    isErrorPage="true"
%>
15
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
16
<%  boolean debug = "true".equals(JiveGlobals.getProperty("skin.default.debug"));
Matt Tucker's avatar
Matt Tucker committed
17 18 19 20 21 22 23 24
    if (debug) {
        exception.printStackTrace();
    }
%>

<%  if (exception instanceof UnauthorizedException) { %>

    <p>
25
    <fmt:message key="error.admin_privileges" />
Matt Tucker's avatar
Matt Tucker committed
26 27 28 29 30 31
    </p>

<%  } else if (exception instanceof UserNotFoundException) {
        String username = ParamUtils.getParameter(request,"username");
%>
        <p>
Bill Lynch's avatar
Bill Lynch committed
32 33 34 35 36 37
        <%  if (username == null) { %>
            <fmt:message key="error.requested_user_not_found" />
        <%  } else { %>
            <fmt:message key="error.specific_user_not_found">
                <fmt:param value="${username}" />
            </fmt:message>
Matt Tucker's avatar
Matt Tucker committed
38 39 40 41 42 43
        <%  } %>
        </p>

<%  } else if (exception instanceof GroupNotFoundException) { %>

    <p>
44
    <fmt:message key="error.not_found_group" />
Matt Tucker's avatar
Matt Tucker committed
45 46 47 48 49 50 51 52 53
    </p>
    
<%  } %>

<%  if (exception != null) {
        StringWriter sout = new StringWriter();
        PrintWriter pout = new PrintWriter(sout);
        exception.printStackTrace(pout);
%>
54
    <fmt:message key="error.exception" />
Bill Lynch's avatar
Bill Lynch committed
55
    <pre>
Matt Tucker's avatar
Matt Tucker committed
56 57 58
<%= sout.toString() %>
    </pre>

Bill Lynch's avatar
Bill Lynch committed
59
<%  } %>