Examples of ForwardConfig


Examples of com.dotcms.repackage.org.apache.struts.config.ForwardConfig

        }

        String forwardMapping = getBundleFolder( context ) + path;

        // Creating an ForwardConfig Instance
        ForwardConfig forwardConfig = new ActionForward( name, forwardMapping, redirect );
        // Adding the ForwardConfig to the ActionConfig
        actionMapping.addForwardConfig( forwardConfig );

        //Copy all the resources inside the folder of the given resource to the corresponding dotCMS folders
        moveResources( context, path );
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

   * @throws ServletException
   * @throws IOException
   */
  public boolean execute(Context ctx) throws ServletException, IOException {
    ServletActionContext context = (ServletActionContext)ctx;
    ForwardConfig forward = context.getForwardConfig();
    if (forward == null || forward.getPath() == null || forward.getRedirect()) {
      return false;
    }
    if (forward.getModule() != null && !forward.getModule().equals(context.getModuleConfig().getPrefix())) {
      return false;
    }
    HttpServletRequest request = context.getRequest();
    PanelsSupport support = PanelsSupport.getInstance(request);
    Locale locale = I18nSupport.getInstance(request).getLocale(request);
    PanelConfig panel = support.findPanelConfig(forward.getPath(), locale);
    if (panel != null) {
      String template = panel.findTemplate(locale);
      if (template == null) {
        throw new ServletException("Cannot find template for panel " + panel.getName());
      }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     */
    public boolean execute(Context context) throws Exception {

        // Is there a Tiles Definition to be processed?
        ServletActionContext sacontext = (ServletActionContext) context;
        ForwardConfig forwardConfig = sacontext.getForwardConfig();
        if (forwardConfig == null || forwardConfig.getPath() == null)
        {
            log.debug("No forwardConfig or no path, so pass to next command.");
            return (false);
        }


        ComponentDefinition definition = null;
        try
        {
            definition = TilesUtil.getDefinition(forwardConfig.getPath(),
                    sacontext.getRequest(),
                    sacontext.getContext());
        }
        catch (FactoryNotFoundException ex)
        {
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        ActionConfig actionConfig =
            (ActionConfig)request.getAttribute(Globals.MAPPING_KEY);

        // NOTE: ActionConfig.findForwardConfig only searches local forwards
        ForwardConfig fc = null;
        if(actionConfig != null)
        {
            fc = actionConfig.findForwardConfig(forward);

            // No ActionConfig forward?
            // Find the ForwardConfig in the global-forwards.
            if(fc == null)
            {
                fc = moduleConfig.findForwardConfig(forward);

                // ok, give up
                if (fc == null)
                {
                    return null;
                }
            }
        }

        StringBuffer url = new StringBuffer();
        if (fc.getPath().startsWith("/"))
        {
            url.append(request.getContextPath());
            url.append(RequestUtils.forwardURL(request, fc, moduleConfig));
        }
        else
        {
            url.append(fc.getPath());
        }
        return url.toString();
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        mapping.setPath("/noform");
        mapping.setType("org.apache.struts.mock.MockAction");
        moduleConfig.addActionConfig(mapping);

        // Configure global forward declarations
        moduleConfig.addForwardConfig(new ForwardConfig("moduleForward",
                "/module/forward", false)); // No redirect, same module

        moduleConfig.addForwardConfig(new ForwardConfig("moduleRedirect",
                "/module/redirect", true)); // Redirect, same module

        moduleConfig.addForwardConfig(new ForwardConfig("contextForward",
                "/forward", false, // No redirect
                "/context")); // Specify module

        moduleConfig.addForwardConfig(new ForwardConfig("contextRedirect",
                "/redirect", true, // Redirect
                "/context")); // Specify module

        moduleConfig.addForwardConfig(new ForwardConfig("moduleNoslash",
                "module/noslash", false)); // No redirect, same module

        moduleConfig.addForwardConfig(new ForwardConfig("contextNoslash",
                "noslash", false, // No redirect
                "/context")); // Specify module
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        mapping.setPath("/noform");
        mapping.setType("org.apache.struts.mock.MockAction");
        moduleConfig2.addActionConfig(mapping);

        // Configure global forward declarations
        moduleConfig2.addForwardConfig(new ForwardConfig("moduleForward",
                "/module/forward", false)); // No redirect, same module

        moduleConfig2.addForwardConfig(new ForwardConfig("moduleRedirect",
                "/module/redirect", true)); // Redirect, same module

        moduleConfig2.addForwardConfig(new ForwardConfig("contextForward",
                "/forward", false, // No redirect
                "/context")); // Specify module

        moduleConfig2.addForwardConfig(new ForwardConfig("contextRedirect",
                "/redirect", true, // Redirect
                "/context")); // Specify module

        moduleConfig2.addForwardConfig(new ForwardConfig("moduleNoslash",
                "module/noslash", false)); // No redirect, same module

        moduleConfig2.addForwardConfig(new ForwardConfig("contextNoslash",
                "noslash", false, // No redirect
                "/context")); // Specify module
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        controller.setForwardPattern("/forwarding$M$P");
        controller.setInputForward(true);
        controller.setPagePattern("/paging$M$P");

        // Configure global forward declarations
        moduleConfig3.addForwardConfig(new ForwardConfig("moduleForward",
                "/module/forward", false)); // No redirect, same module

        moduleConfig3.addForwardConfig(new ForwardConfig("moduleRedirect",
                "/module/redirect", true)); // Redirect, same module

        moduleConfig3.addForwardConfig(new ForwardConfig("contextForward",
                "/forward", false, // No redirect
                "/context")); // Specify module

        moduleConfig3.addForwardConfig(new ForwardConfig("contextRedirect",
                "/redirect", true, // Redirect
                "/context")); // Specify module

        moduleConfig3.addForwardConfig(new ForwardConfig("moduleNoslash",
                "module/noslash", false)); // No redirect, same module

        moduleConfig3.addForwardConfig(new ForwardConfig("contextNoslash",
                "noslash", false, // No redirect
                "/context")); // specify module
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     * @param forwardName Logical name of the forwarding instance to be
     *                    returned
     * @return The local or global forward with the specified name.
     */
    public ActionForward findForward(String forwardName) {
        ForwardConfig config = findForwardConfig(forwardName);

        if (config == null) {
            config = getModuleConfig().findForwardConfig(forwardName);
        }

View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

        }

        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

Examples of org.apache.struts.config.ForwardConfig

        // Process forwards extensions.
        ForwardConfig[] forwards = config.findForwardConfigs();

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

            processForwardExtension(forward, config);
        }

        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");
            }
        }
    }
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.