zoukankan      html  css  js  c++  java
  • Tapestry ErrorReport

    AppModule.java

        public static void contributeServiceOverride(
                MappedConfiguration<Class<?>, Object> configuration,
                @Local RequestExceptionHandler handler)
        {
            configuration.add(RequestExceptionHandler.class, handler);
        }
        
        public RequestExceptionHandler buildRequestExceptionHandler2(final ResponseRenderer renderer,
                final ComponentSource componentSource)
        {
            return new RequestExceptionHandler() {
                public void handleRequestException(Throwable exception) throws IOException
                {
                    ExceptionReporter errorPage = (ExceptionReporter) componentSource.getPage("ErrorReporter");
                    errorPage.reportException(exception);
                    renderer.renderPageMarkupResponse("ErrorReporter");
                }
            };
        }

    ErrorReporter.java

    public class ErrorReporter implements ExceptionReporter
    {
    
        @Property
        private String errorMessage;
    
        public void reportException(Throwable exception)
        {
            errorMessage = exception.getMessage();
        }
    
    }

    基本就是上面的样子了。。。

  • 相关阅读:
    mysql修改加密方式
    信息安全学习路线
    DNS域传送漏洞
    CSRF漏洞
    反序列化漏洞
    计算机通讯基础
    gorm gen使用
    golang makefile使用
    linux命令行录制
    go代码自动生成注释
  • 原文地址:https://www.cnblogs.com/voctrals/p/3012554.html
Copyright © 2011-2022 走看看