为org.apache.wicket.util.resource启用调试消息

问题

在Wicket中,当找不到html页面时,它将引发“ 为org.apache.wicket.util.resource启用调试消息以获取所有尝试过的文件名的列表 ”。 想知道如何为Wicket资源启用调试消息?

Root cause:
org.apache.wicket.markup.MarkupNotFoundException: 
Markup of type 'html' for component 'com.mkyong.hello.Hello' not found. 

Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: 
[Page class = com.mkyong.hello.Hello, id = 0, version = 0]
at org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:227)
...

我也不知道如何在“ org.apache.wicket.util.resource ”上启用调试,Wicket错误消息应该更清晰!

或者,您可以启用调试模式下的日志记录,并跟踪Wicket如何通过日志文件查找资源。 例如, 将log4j与Wicket集成

log4j输出样本…

DEBUG MarkupCache:300 - Load markup: cacheKey=com.mkyong.hello.Helloen_US.html
DEBUG ResourceStreamLocator:216 - Attempting to locate resource 
'com/mkyong/hello/Hello_en_US.html' on path [folders = [], webapppaths: [/pages/]]

DEBUG ResourceStreamLocator:186 - Attempting to locate resource 
'com/mkyong/hello/Hello_en_US.html' using classloader WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
...
DEBUG ResourceStreamLocator:216 - Attempting to locate resource 
'com/mkyong/hello/Hello.html' on path [folders = [], webapppaths: [/pages/]]
DEBUG ResourceStreamLocator:186 - Attempting to locate resource 
'com/mkyong/hello/Hello.html' using classloader WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
...

翻译自: https://mkyong.com/wicket/enable-debug-messages-for-org-apache-wicket-util-resource/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值