Package org.apache.struts.config

Examples of org.apache.struts.config.ForwardConfig


     * Return the form bean configurations for this module.  If there
     * are none, a zero-length array is returned.
     */
    public ForwardConfig[] findForwardConfigs() {

        ForwardConfig results[] = new ForwardConfig[forwards.size()];
        return ((ForwardConfig[]) forwards.values().toArray(results));

    }
View Full Code Here


        assertTrue("Input hasn't been replaced", "input,Bar".equals(m.getInput()));

        ForwardConfig[] fConfigs = m.findForwardConfigs();
        boolean found = false;
        for (int x=0; x<fConfigs.length; x++) {
            ForwardConfig cfg = fConfigs[x];
            if ("name".equals(cfg.getName())) {
                found = true;
                assertTrue("ContextRelative isn't correct", cfg.getContextRelative());
                assertTrue("Path hasn't been replaced", "path,Bar".equals(cfg.getPath()));
            }
        }
        assertTrue("The forward config 'name' cannot be found", found);
    }
View Full Code Here

        mapping.setAttribute("attrib,{1}");
        mapping.setForward("fwd,{1}");
        mapping.setInclude("include,{1}");
        mapping.setInput("input,{1}");

        ForwardConfig cfg = new ActionForward();
        cfg.setContextRelative(true);
        cfg.setName("name");
        cfg.setPath("path,{1}");
        mapping.addForwardConfig(cfg);
       
        cfg = new ActionForward();
        cfg.setContextRelative(true);
        cfg.setName("name2");
        cfg.setPath("path2");
        mapping.addForwardConfig(cfg);
        ExceptionConfig excfg = new ExceptionConfig();
        excfg.setKey("foo");
        excfg.setType("foo.Bar");
View Full Code Here

    // If an action level forward does not exist for the delegate then
    // look for a global forward of the module config for this action
    // mapping. Then, if still not found, look in the module config of
    // the delegate.
    public ActionForward findForward(String forwardName) {
        ForwardConfig config = _delegate.findForwardConfig(forwardName);
        if (config == null) {
            config = getModuleConfig().findForwardConfig(forwardName);
        }
        if (config == null) {
            config = _delegate.getModuleConfig().findForwardConfig(forwardName);
View Full Code Here

        // Calculate the appropriate URL
        StringBuffer url = new StringBuffer();
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        if (forward != null) {
            ForwardConfig fc = config.findForwardConfig(forward);
            if (fc == null) {
                throw new MalformedURLException(messages.getMessage("computeURL.forward", forward));
            }
            if (fc.getRedirect()) {
                redirect = true;
            }
            if (fc.getPath().startsWith("/")) {
                url.append(request.getContextPath());
                url.append(forwardURL(request, fc));
            } else {
                url.append(fc.getPath());
            }
        } else if (href != null) {
            url.append(href);
        } else if (action != null) {
        url.append(getActionMappingURL(action, pageContext));
View Full Code Here

     * Return the form bean configurations for this module.  If there
     * are none, a zero-length array is returned.
     */
    public ForwardConfig[] findForwardConfigs() {

        ForwardConfig results[] = new ForwardConfig[forwards.size()];
        return ((ForwardConfig[]) forwards.values().toArray(results));

    }
View Full Code Here

            log.debug(" Validation failed, returning to '" + input + "'");
        }
        request.setAttribute(Globals.ERROR_KEY, errors);

        if (moduleConfig.getControllerConfig().getInputForward()) {
            ForwardConfig forward = mapping.findForward(input);
            processForwardConfig( request, response, forward);
        } else {
            internalModuleRelativeForward(input, request, response);
        }
View Full Code Here

     * @since Struts 1.1
     * @deprecated Will be removed in a release after Struts 1.1.
     */
    private void defaultForwardsConfig(ModuleConfig config) {

        ForwardConfig fcs[] = config.findForwardConfigs();
        ActionForwards af = new ActionForwards();
        af.setFast(false);
        for (int i = 0; i < fcs.length; i++) {
            af.addForward((ActionForward) fcs[i]);
        }
View Full Code Here

        // Calculate the appropriate URL
        StringBuffer url = new StringBuffer();
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        if (forward != null) {
            ForwardConfig forwardConfig = moduleConfig.findForwardConfig(forward);
            if (forwardConfig == null) {
                throw new MalformedURLException(messages.getMessage("computeURL.forward", forward));
            }
            if (forwardConfig.getRedirect()) {
                redirect = true;
            }
            if (forwardConfig.getPath().startsWith("/")) {
                url.append(request.getContextPath());
                url.append(RequestUtils.forwardURL(request, forwardConfig, moduleConfig));
            } else {
                url.append(forwardConfig.getPath());
            }
        } else if (href != null) {
            url.append(href);
        } else if (action != null) {
            url.append(instance.getActionMappingURL(action, module, pageContext, false));
View Full Code Here

     *
     * @param name Logical name of the forwarding instance to be returned
     */
    public ActionForward findForward(String name) {

        ForwardConfig config = findForwardConfig(name);
        if (config == null) {
            config = getModuleConfig().findForwardConfig(name);
        }
        return ((ActionForward) config);

View Full Code Here

TOP

Related Classes of org.apache.struts.config.ForwardConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.