Package org.apache.struts.config

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


        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

        // 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

        // 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

     *
     * @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

        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

     * @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

       
        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

     * "/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

        customSub.setName("failure");
        customSub.setExtends("success");
        moduleConfig.addForwardConfig(customSub);

        ForwardConfig result =
            actionServlet.processForwardConfigClass(customSub, moduleConfig);

        assertTrue("Incorrect class of forward config",
            result instanceof CustomForwardConfig);
        assertEquals("Incorrect name", customSub.getName(), result.getName());
        assertEquals("Incorrect path", customSub.getPath(), result.getPath());
        assertEquals("Incorrect extends", customSub.getExtends(),
            result.getExtends());

        assertSame("Result was not registered in the module config", result,
            moduleConfig.findForwardConfig("failure"));
    }
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.