我没有找到更简单的解决方案。我编写了自己的类,在其中更改了属性的路径:
package org.toursys.web.finder;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.locator.ResourceStreamLocator;
public class CustomResourceStreamLocator extends ResourceStreamLocator {
@Override
protected IResourceStream locateByClassLoader(Class<?> clazz, final String path) {
String newPath = path;
if (newPath.endsWith(".properties")) {
newPath = path.substring(0, path.lastIndexOf("/")) + "/properties" + path.substring(path.lastIndexOf("/"));
}
IResourceStream stream = super.locateByClassLoader(clazz, newPath);
if (stream == null) {
stream = super.locateByClassLoader(clazz, path);
}
return stream;
}
}
然后我将此流定位器添加到我的应用程序