润乾报表分析2-定义报表异常页面

来源:互联网 发布:如何开淘宝店 知乎 编辑:程序博客网 时间:2024/04/28 12:13
<report:html  name="report1" reportFileName="<%=report%>"
    funcBarLocation="top"
    params="<%=params.toString()%>"
    exceptionPage="/jsp/2/2.1/2.1.2/exception.jsp"     //直接在些处定义就行
/>
例:
<%@ page contentType="text/html;charset=GBK" isErrorPage="true" %>
    <html>
    <title>报表异常信息</title>
    <body>
    <%    if(exception!=null){
            //jsp等程序运行出错时,采用应用服务器的errorPage机制来处理,此乃J2EE标准
                out.println("<div style='color:red'>" + exception + "</div>");
        }else{   
            //仅处理报表运行出错
            Throwable e = ( Throwable ) request.getAttribute( "exception" );
            out.println( "<div style='color:red'>" + e.getMessage() + "</div>" );
        }
    %>
    </body>
    </html>
原创粉丝点击