当我尝试登录我的 OpenCMS 网站的会员部分时收到以下错误消息。/
javax.servlet.ServletException: javax.servlet.jsp.JspException: 读取父文件夹“/warrants/”的子资源时出错。
我对java很陌生,无法理解问题所在..任何人都可以帮忙..
最好的问候, 安兹
即使您说您是 java 新手,我也必须参考一些源代码。
ERR_READ_RESOURCES_1是您看到的错误消息。这意味着您无权访问文件夹内容。
/**
* Reads all resources below the given path matching the filter criteria,
* including the full tree below the path only in case the <code>readTree</code>
* parameter is <code>true</code>.<p>
*
* @param context the current request context
* @param parent the parent path to read the resources from
* @param filter the filter
* @param readTree <code>true</code> to read all subresources
*
* @return a list of <code>{@link CmsResource}</code> objects matching the filter criteria
*
* @throws CmsSecurityException if the user has insufficient permission for the given resource (read is required)
* @throws CmsException if something goes wrong
*
*/
public List readResources(CmsRequestContext context,
CmsResource parent, CmsResourceFilter filter,
boolean readTree) throws CmsException, CmsSecurityException {
List result = null;
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
// check the access permissions
checkPermissions(dbc, parent, CmsPermissionSet.ACCESS_READ,
true, CmsResourceFilter.ALL);
result = m_driverManager.readResources(dbc, parent, filter,
readTree);
} catch (Exception e) {
dbc.report(null, Messages.get().container(
Messages.ERR_READ_RESOURCES_1,
context.removeSiteRoot(parent.getRootPath())), e);
} finally {
dbc.clear();
}
return result;
}