/** * <p> Remove the specified forward configuration instance. </p> * * @param config ForwardConfig instance to be removed * @throws IllegalStateException if this module configuration has been * frozen */ public void removeForwardConfig(ForwardConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } forwards.remove(config.getName()); }
/** * Remove the specified forward configuration instance. * * @param config ForwardConfig instance to be removed * * @exception IllegalStateException if this module configuration * has been frozen */ public void removeForwardConfig(ForwardConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } forwards.remove(config.getName()); }
/** * Add a new <code>ForwardConfig</code> instance to the set of global * forwards associated with this action. * * @param config The new configuration instance to be added * * @exception IllegalStateException if this module configuration * has been frozen */ public void addForwardConfig(ForwardConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } forwards.put(config.getName(), config); }
/** * Remove the specified forward configuration instance. * * @param config ForwardConfig instance to be removed * * @exception IllegalStateException if this module configuration * has been frozen */ public void removeForwardConfig(ForwardConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } forwards.remove(config.getName()); }
/** * <p> Add a new <code>ForwardConfig</code> instance to the set of global * forwards associated with this action. </p> * * @param config The new configuration instance to be added * @throws IllegalStateException if this module configuration has been * frozen */ public void addForwardConfig(ForwardConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } forwards.put(config.getName(), config); }
/** * Add a new <code>ForwardConfig</code> instance to the set of global * forwards associated with this module. * * @param config The new configuration instance to be added * * @exception java.lang.IllegalStateException if this module configuration * has been frozen */ public void addForwardConfig(ForwardConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } forwards.put(config.getName(), config); }
/** * <p> Remove the specified forward configuration instance. </p> * * @param config ForwardConfig instance to be removed * @throws IllegalStateException if this module configuration has been * frozen */ public void removeForwardConfig(ForwardConfig config) { throwIfConfigured(); forwards.remove(config.getName()); }
/** * <p>Return the logical names of all locally defined forwards for this * mapping. If there are no such forwards, a zero-length array * is returned.</p> */ public String[] findForwards() { ArrayList results = new ArrayList(); ForwardConfig fcs[] = findForwardConfigs(); for (int i = 0; i < fcs.length; i++) { results.add(fcs[i].getName()); } return ((String[]) results.toArray(new String[results.size()])); }
/** * <p> Add a new <code>ForwardConfig</code> instance to the set of global * forwards associated with this module. </p> * * @param config The new configuration instance to be added * @throws IllegalStateException if this module configuration has been * frozen */ public void addForwardConfig(ForwardConfig config) { throwIfConfigured(); String key = config.getName(); if (forwards.containsKey(key)) { log.warn("Overriding global ActionForward of name " + key); } forwards.put(key, config); }
/** * <p>Return the logical names of all locally defined forwards for this * mapping. If there are no such forwards, a zero-length array is * returned.</p> * * @return The forward names for this action mapping. */ public String[] findForwards() { ArrayList results = new ArrayList(); ForwardConfig[] fcs = findForwardConfigs(); for (int i = 0; i < fcs.length; i++) { results.add(fcs[i].getName()); } return ((String[]) results.toArray(new String[results.size()])); }
public String[] getForwardNames(String siteName, String path) { List<String> nameList = new ArrayList<String>(); ActionConfig actionConfig = getActionConfig(siteName, path); ForwardConfig[] configs = actionConfig.findForwardConfigs(); for (int i = 0; i < configs.length; i++) { ForwardConfig config = configs[i]; String name = config.getName(); nameList.add(name); } return nameList.toArray(new String[nameList.size()]); }
/** * <p>Construct a new instance based on the values of another * ForwardConfig.</p> * * @param copyMe A ForwardConfig instance to copy * @since Struts 1.3.6 */ public ForwardConfig(ForwardConfig copyMe) { this(copyMe.getName(), copyMe.getPath(), copyMe.getRedirect(), copyMe.getModule()); }
/** * <p>Return <code>true</code> if information returned by * <code>config.findForwardConfigs</code> is all valid; otherwise, log * error messages and return <code>false</code>.</p> */ protected boolean verifyForwardConfigs() { boolean ok = true; ForwardConfig[] fcs = config.findForwardConfigs(); for (int i = 0; i < fcs.length; i++) { String path = fcs[i].getPath(); if (path == null) { LOG.error(servlet.getInternal().getMessage("verifyForwardConfigs.missing", fcs[i].getName())); ok = false; } else if (!path.startsWith("/")) { LOG.error(servlet.getInternal().getMessage("verifyForwardConfigs.invalid", path, fcs[i].getName())); } } return (ok); }
public class CustomizedTileProcessor extends TilesRequestProcessor { @Override protected void processForwardConfig(HttpServletRequest pRequest, HttpServletResponse pResponse, ForwardConfig pForward) throws IOException, ServletException { if(isChromeBrowser(pRequest)) { ForwardConfig newForward = new ForwardConfig(pForward.getName(), pForward.getPath()+"_chrome", pForward.getRedirect(), pForward.getContextRelative()); super.processForwardConfig(pRequest, pResponse, newForward); } else { super.processForwardConfig(pRequest, pResponse, pForward); } } }
/** * <p> * Extend the forward's configuration as necessary. * </p> * * @param forwardConfig * the configuration to process. * @param moduleConfig * the module configuration for this module. * @throws ServletException * if initialization cannot be performed. */ protected void processForwardExtension(ForwardConfig forwardConfig, ModuleConfig moduleConfig) throws ServletException { try { if (!forwardConfig.isExtensionProcessed()) { if (log.isDebugEnabled()) { log.debug("Processing extensions for '" + forwardConfig.getName() + "'"); } forwardConfig = processForwardConfigClass(forwardConfig, moduleConfig); forwardConfig.processExtends(moduleConfig, null); } } catch (ServletException e) { throw e; } catch (Exception e) { handleGeneralExtensionException("Forward", forwardConfig.getName(), e); } }
/** * <p>Construct a new instance based on the values of another ActionForward.</p> * * @param copyMe An ActionForward instance to copy * @since Struts 1.2.1 */ public ActionForward(ActionForward copyMe) { this(copyMe.getName(),copyMe.getPath(),copyMe.getRedirect(),copyMe.getModule()); setContextRelative(copyMe.getContextRelative()); }
/** * <p>Initialize the forwards for the specified module.</p> * * @param config ModuleConfig information for this module * @throws ServletException if initialization cannot be performed */ protected void initModuleForwards(ModuleConfig config) throws ServletException { if (log.isDebugEnabled()) { log.debug("Initializing module path '" + config.getPrefix() + "' forwards"); } // Process forwards extensions. ForwardConfig[] forwards = config.findForwardConfigs(); for (int i = 0; i < forwards.length; i++) { ForwardConfig forward = forwards[i]; processForwardExtension(forward, config, null); } for (int i = 0; i < forwards.length; i++) { ForwardConfig forward = forwards[i]; // Verify that required fields are all present for the forward if (forward.getPath() == null) { handleValueRequiredException("path", forward.getName(), "global forward"); } } }
/** * <p>Return <code>true</code> if information returned by * <code>config.findForwardConfigs</code> is all valid; * otherwise, log error messages and return <code>false</code>.</p> */ protected boolean verifyForwardConfigs() { boolean ok = true; ForwardConfig fcs[] = config.findForwardConfigs(); for (int i = 0; i < fcs.length; i++) { String path = fcs[i].getPath(); if (path == null) { log(servlet.getInternal().getMessage ("verifyForwardConfigs.missing", fcs[i].getName())); ok = false; } else if (!path.startsWith("/")) { log(servlet.getInternal().getMessage ("verifyForwardConfigs.invalid", path, fcs[i].getName())); } } return (ok); }
/** * <p>Construct a new instance with a {@link ForwardConfig} object to copy * name, path, contextRelative, and arbitrary property values from.</p> * * @param baseConfig the {@link ForwardConfig} to copy configuration * values from */ public ActionRedirect(ForwardConfig baseConfig) { setName(baseConfig.getName()); setPath(baseConfig.getPath()); setModule(baseConfig.getModule()); setRedirect(true); inheritProperties(baseConfig); initializeParameters(); }
/** * <p>Construct a new instance with a {@link ForwardConfig} object * to copy name, path, and contextRelative values from.</p> * * @param baseConfig the {@link ForwardConfig} * to copy configuration values from */ public ActionRedirect(ForwardConfig baseConfig) { setName(baseConfig.getName()); setPath(baseConfig.getPath()); setContextRelative(baseConfig.getContextRelative()); setModule(baseConfig.getModule()); setRedirect(true); initializeParameters(); }