/** * <p> Replaces placeholders from one Properties values set to another. * </p> * * @param orig The original properties set with placehold values * @param props The target properties to store the processed values * @param vars A Map of wildcard-matched strings */ protected void replaceProperties(Properties orig, Properties props, Map vars) { Map.Entry entry = null; for (Iterator i = orig.entrySet().iterator(); i.hasNext();) { entry = (Map.Entry) i.next(); props.setProperty((String) entry.getKey(), convertParam((String) entry.getValue(), vars)); } }
/** * Return the action configuration for the specified path, first looking * a direct match, then if none found, a wildcard pattern match; * otherwise return <code>null</code>. * * @param path Path of the action configuration to return */ public ActionConfig findActionConfig(String path) { ActionConfig config = (ActionConfig) actionConfigs.get(path); // If a direct match cannot be found, try to match action configs // containing wildcard patterns if (config == null) { config = matcher.match(path); } return config; }
config.setName(convertParam(orig.getName(), vars)); config.setType(convertParam(orig.getType(), vars)); config.setRoles(convertParam(orig.getRoles(), vars)); config.setParameter(convertParam(orig.getParameter(), vars)); config.setAttribute(convertParam(orig.getAttribute(), vars)); config.setForward(convertParam(orig.getForward(), vars)); config.setInclude(convertParam(orig.getInclude(), vars)); config.setInput(convertParam(orig.getInput(), vars)); config.setCatalog(convertParam(orig.getCatalog(), vars)); config.setCommand(convertParam(orig.getCommand(), vars)); config.setMultipartClass(convertParam(orig.getMultipartClass(), vars)); config.setPrefix(convertParam(orig.getPrefix(), vars)); config.setSuffix(convertParam(orig.getSuffix(), vars)); cfg.setPath(convertParam(fConfigs[x].getPath(), vars)); cfg.setRedirect(fConfigs[x].getRedirect()); cfg.setCommand(convertParam(fConfigs[x].getCommand(), vars)); cfg.setCatalog(convertParam(fConfigs[x].getCatalog(), vars)); cfg.setModule(convertParam(fConfigs[x].getModule(), vars)); replaceProperties(fConfigs[x].getProperties(), cfg.getProperties(), vars); replaceProperties(orig.getProperties(), config.getProperties(), vars);
m = (Mapping) i.next(); if (wildcard.match(vars, path, m.getPattern())) { config = convertActionConfig( path, (ActionConfig) m.getActionConfig(),
matcher = new ActionConfigMatcher(aconfigs);
convertActionConfig(path, (ActionConfig) m.getActionConfig(), vars);
aconfigs[i].freeze(); matcher = new ActionConfigMatcher(aconfigs);
/** * <p> Return the action configuration for the specified path, first * looking a direct match, then if none found, a wildcard pattern match; * otherwise return <code>null</code>. </p> * * @param path Path of the action configuration to return */ public ActionConfig findActionConfig(String path) { ActionConfig config = (ActionConfig) actionConfigs.get(path); // If a direct match cannot be found, try to match action configs // containing wildcard patterns only if a matcher exists. if ((config == null) && (matcher != null)) { config = matcher.match(path); } return config; }
config.setName(convertParam(orig.getName(), vars)); if (path.length() == 0 || path.charAt(0) != '/') { path = "/" + path; config.setType(convertParam(orig.getType(), vars)); config.setRoles(convertParam(orig.getRoles(), vars)); config.setParameter(convertParam(orig.getParameter(), vars)); config.setAttribute(convertParam(orig.getAttribute(), vars)); config.setForward(convertParam(orig.getForward(), vars)); config.setInclude(convertParam(orig.getInclude(), vars)); config.setInput(convertParam(orig.getInput(), vars)); cfg.setContextRelative(fConfigs[x].getContextRelative()); cfg.setName(fConfigs[x].getName()); cfg.setPath(convertParam(fConfigs[x].getPath(), vars)); cfg.setRedirect(fConfigs[x].getRedirect()); config.removeForwardConfig(fConfigs[x]);