moduleConfig是ModuleConfig类型,用于保存配置文件.xml中的相关配置及request、context相关信息。例如获取DataSource接口:
protected DataSource getDataSource(HttpServletRequest request, String key) { // Identify the current module
ServletContext context = getServlet().getServletContext();
ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request,context); // Return the requested data source instance
return ((DataSource) context.getAttribute(key + moduleConfig.getPrefix())); }
protected DataSource getDataSource(HttpServletRequest request, String key) { // Identify the current module
ServletContext context = getServlet().getServletContext();
ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request,context); // Return the requested data source instance
return ((DataSource) context.getAttribute(key + moduleConfig.getPrefix())); }
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货