error.jsp 1.7 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,
Sven Tantau's avatar
Sven Tantau committed
10
                 org.jivesoftware.util.StringUtils,
11 12 13
                 org.jivesoftware.openfire.auth.UnauthorizedException,
                 org.jivesoftware.openfire.user.UserNotFoundException,
                 org.jivesoftware.openfire.group.GroupNotFoundException"
Matt Tucker's avatar
Matt Tucker committed
14 15
    isErrorPage="true"
%>
16
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
17
<fmt:setBundle basename="openfire_i18n"/>
18
<%  boolean debug = "true".equals(JiveGlobals.getProperty("skin.default.debug"));
Matt Tucker's avatar
Matt Tucker committed
19 20 21 22 23 24 25 26
    if (debug) {
        exception.printStackTrace();
    }
%>

<%  if (exception instanceof UnauthorizedException) { %>

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

<%  } else if (exception instanceof UserNotFoundException) {
        String username = ParamUtils.getParameter(request,"username");
%>
        <p>
Bill Lynch's avatar
Bill Lynch committed
34 35 36 37 38 39
        <%  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
40 41 42 43 44 45
        <%  } %>
        </p>

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

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

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

Sven Tantau's avatar
Sven Tantau committed
61
<%  } %>