Package org.apache.struts.config

Examples of org.apache.struts.config.ModuleConfig


    protected void process(HttpServletRequest request,
        HttpServletResponse response)
        throws IOException, ServletException {
        ModuleUtils.getInstance().selectModule(request, getServletContext());

        ModuleConfig config = getModuleConfig(request);

        RequestProcessor processor = getProcessorForModule(config);

        if (processor == null) {
            processor = getRequestProcessor(config);
View Full Code Here


        StringBuffer results = new StringBuffer();

        HttpServletRequest request =
          (HttpServletRequest)pageContext.getRequest();
        ServletContext servletContext = pageContext.getServletContext();
        ModuleConfig config =
          ModuleUtils.getInstance().getModuleConfig(request, servletContext);

        ValidatorResources resources =
            (ValidatorResources) pageContext.getAttribute(
                ValidatorPlugIn.VALIDATOR_KEY + config.getPrefix(),
                PageContext.APPLICATION_SCOPE);

        Locale locale = TagUtils.getInstance().getUserLocale(pageContext, null);

        Form form = resources.getForm(locale, formName);
        if (form != null) {
            if ("true".equalsIgnoreCase(dynamicJavascript)) {
                MessageResources messages =
                    (MessageResources) pageContext.getAttribute(
                        bundle + config.getPrefix(),
                        PageContext.APPLICATION_SCOPE);

                List lActions = new ArrayList();
                List lActionMethods = new ArrayList();
View Full Code Here

     * @return <code>true</code> so that processing completes
     * @throws Exception if thrown by the <code>Action</code>
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        ModuleConfig moduleConfig = actionCtx.getModuleConfig();

        // Is there an include to be performed?
        String include = actionCtx.getInclude();

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

        // Determine the currect uri
        String uri = moduleConfig.getPrefix() + include;

        // Perform the appropriate processing on this include uri
        perform(actionCtx, uri);

        return (true);
View Full Code Here

     * @throws Exception if thrown by the Action class
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Retrieve the ModuleConfig instance
        ModuleConfig moduleConfig = actionCtx.getModuleConfig();

        // If the module is configured for no caching, request no caching
        if (moduleConfig.getControllerConfig().getNocache()) {
            requestNoCache(actionCtx);
        }

        return (false);
    }
View Full Code Here

            return (false);
        }

        // 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 + "'");
            }

            forwardConfig = actionConfig.findForwardConfig(input);

            if (forwardConfig == null) {
                forwardConfig = moduleConfig.findForwardConfig(input);
            }
        } else {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Delegating to forward() for '" + input + "'");
            }
View Full Code Here

    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Are we configured to select Locale automatically?
        LOG.trace("retrieve config...");

        ModuleConfig moduleConfig = actionCtx.getModuleConfig();

        if (!moduleConfig.getControllerConfig().getLocale()) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("module is not configured for a specific locale; "
                    + "nothing to do");
            }
View Full Code Here

            return (false);
        }

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

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

        if (forward != null) {
View Full Code Here

        }

        // Look up the local or global exception handler configuration
        ExceptionConfig exceptionConfig = null;
        ActionConfig actionConfig = actionCtx.getActionConfig();
        ModuleConfig moduleConfig = actionCtx.getModuleConfig();

        if (actionConfig != null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("See if actionConfig " + actionConfig
                    + " has an exceptionConfig for "
                    + exception.getClass().getName());
            }

            exceptionConfig = actionConfig.findException(exception.getClass());
        } else if (moduleConfig != null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("No action yet, see if moduleConfig " + moduleConfig
                    + " has an exceptionConfig "
                    + exception.getClass().getName());
            }

            exceptionConfig = moduleConfig.findException(exception.getClass());
        }

        // Handle the exception in the configured manner
        if (exceptionConfig == null) {
            LOG.warn("Unhandled exception", exception);
View Full Code Here

    public boolean execute(ActionContext actionCtx)
        throws Exception {
        String prefix = getPrefix(actionCtx);

        // Cache the corresponding ModuleConfig and MessageResources instances
        ModuleConfig moduleConfig =
            (ModuleConfig) actionCtx.getApplicationScope().get(Globals.MODULE_KEY
                + prefix);

        if (moduleConfig == null) {
            throw new IllegalArgumentException("No module config for prefix '"
View Full Code Here

     * @throws Exception if thrown by the Action class
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Retrieve the ModuleConfig instance
        ModuleConfig moduleConfig = actionCtx.getModuleConfig();

        // If the content type is configured, set it for the response
        String contentType =
            moduleConfig.getControllerConfig().getContentType();

        if (contentType != null) {
            setContentType(actionCtx, contentType);
        }

View Full Code Here

TOP

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

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.