欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2024-02-23 14:15:52
...

问题

在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/
...

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