Examples of ForwardConfig


Examples of org.apache.struts.config.ForwardConfig

            // Nothing to do, then
            return forwardConfig;
        }

        // Make sure that this config is of the right class
        ForwardConfig baseConfig = moduleConfig.findForwardConfig(ancestor);

        if (baseConfig == null) {
            throw new UnavailableException("Unable to find " + "forward '"
                + ancestor + "' to extend.");
        }

        // Was our forwards's class overridden already?
        if (forwardConfig.getClass().equals(ActionForward.class)) {
            // Ensure that our forward is using the correct class
            if (!baseConfig.getClass().equals(forwardConfig.getClass())) {
                // Replace the config with an instance of the correct class
                ForwardConfig newForwardConfig = null;
                String baseConfigClassName = baseConfig.getClass().getName();

                try {
                    newForwardConfig =
                        (ForwardConfig) RequestUtils.applicationInstance(baseConfigClassName);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

            // Verify that required fields are all present for the forward
            // configs
            ForwardConfig[] forwards = actionConfig.findForwardConfigs();

            for (int j = 0; j < forwards.length; j++) {
                ForwardConfig forward = forwards[j];

                if (forward.getPath() == null) {
                    handleValueRequiredException("path", forward.getName(),
                        "action forward");
                }
            }

            // ... and the exception configs
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        ActionConfig actionConfig = actionCtx.getActionConfig();
        ActionForm actionForm = actionCtx.getActionForm();

        // Execute the Action for this request, caching returned ActionForward
        ForwardConfig forwardConfig =
            execute(actionCtx, action, actionConfig, actionForm);

        actionCtx.setForwardConfig(forwardConfig);

        return (false);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        // Acquire configuration objects that we need
        ActionConfig actionConfig = actionCtx.getActionConfig();
        ModuleConfig moduleConfig = actionConfig.getModuleConfig();

        // Cache an ForwardConfig back to our input page
        ForwardConfig forwardConfig;
        String input = actionConfig.getInput();

        if (moduleConfig.getControllerConfig().getInputForward()) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Finding ForwardConfig for '" + input + "'");
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        // Acquire configuration objects that we need
        ActionConfig actionConfig = actionCtx.getActionConfig();
        ModuleConfig moduleConfig = actionConfig.getModuleConfig();

        ForwardConfig forwardConfig = null;
        String forward = actionConfig.getForward();

        if (forward != null) {
            forwardConfig = forward(actionCtx, moduleConfig, forward);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     *
     * @param context Our ActionContext
     * @return Command to execute or null
     */
    protected Command getCommand(ActionContext context) {
        ForwardConfig forwardConfig = context.getForwardConfig();

        if (forwardConfig == null) {
            return null;
        }

        return getCommand(forwardConfig.getCommand(), forwardConfig.getCatalog());
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        if (exceptionConfig == null) {
            LOG.warn("Unhandled exception", exception);
            throw exception;
        }

        ForwardConfig forwardConfig =
            handle(actionCtx, exception, exceptionConfig, actionConfig,
                moduleConfig);

        if (forwardConfig != null) {
            actionCtx.setForwardConfig(forwardConfig);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     * @throws Exception if thrown by the <code>Action</code>
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Is there a ForwardConfig to be performed?
        ForwardConfig forwardConfig = actionCtx.getForwardConfig();

        if (forwardConfig == null) {
            return (false);
        }

View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

       
        ExceptionConfig[] exceptionConfigs = moduleConfig.findExceptionConfigs();
        assertNotNull(exceptionConfigs);
        assertEquals(1, exceptionConfigs.length);
       
        ForwardConfig fwdConfig = moduleConfig.findForwardConfig("globalResult");
        assertNotNull(fwdConfig);
        assertEquals("globalResult", fwdConfig.getName());
       
        // These methods are currently not implemented -- replace as functionality is added.
        assertNYI(moduleConfig, "getControllerConfig", null);
        assertNYI(moduleConfig, "getActionFormBeanClass", null);
        assertNYI(moduleConfig, "getActionMappingClass", null);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     * "/myapp", "/foo", null, null,
     */
    public void setUp() {
        // -- default Module
        this.moduleConfig = new ModuleConfigImpl("");
        this.moduleConfig.addForwardConfig(new ForwardConfig("foo", "/bar.jsp",
                false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("relative1",
                "relative.jsp", false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("relative2",
                "relative.jsp", false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("external",
                "http://struts.apache.org/", false));

        // -- module "/2"
        this.moduleConfig2 = new ModuleConfigImpl("/2");
        this.moduleConfig2.addForwardConfig(new ForwardConfig("foo",
                "/baz.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative1",
                "relative.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative2",
                "relative.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("external",
                "http://struts.apache.org/", false));

        // -- module "/3"
        this.moduleConfig3 = new ModuleConfigImpl("/3");

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.