Examples of ModuleConfig


Examples of org.apache.struts.config.ModuleConfig

     */
    public static String getForwardURL(HttpServletRequest request,
                                       ServletContext app,
                                       String forward)
    {
        ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);
        //TODO? beware of null module config if ActionServlet isn't init'ed?

        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;
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

        {
            /* Is there a form bean associated with this mapping? */
            this.formName = config.getAttribute();
        }

        ModuleConfig mconfig = ModuleUtils.getInstance().getModuleConfig(request, app);
        this.resources = (ValidatorResources)app.getAttribute(ValidatorPlugIn.
                VALIDATOR_KEY +
                mconfig.getPrefix());

    }
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

        String formName = form.getName();

        jsFormName = formName;
        if(jsFormName.charAt(0) == '/') {
            String mappingName = StrutsUtils.getActionMappingName(jsFormName);
            ModuleConfig mconfig = ModuleUtils.getInstance().getModuleConfig(request, app);

            ActionConfig mapping = (ActionConfig) mconfig.findActionConfig(mappingName);
            if (mapping == null) {
                throw new NullPointerException("Cannot retrieve mapping for action " + mappingName);
            }
            jsFormName = mapping.getAttribute();
        }
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

        // Invoke the appropriate request processor for this request
        try {
            request.setAttribute(Constants.ACTION_EVENT_KEY, event);
            ModuleUtils.getInstance().selectModule(request, servletContext);
            ModuleConfig moduleConfig = (ModuleConfig)
                request.getAttribute(Globals.MODULE_KEY);
            if (log.isTraceEnabled()) {
                log.trace("Assigned to module with prefix '" +
                          moduleConfig.getPrefix() + "'");
            }
            RequestProcessor processor =
                getRequestProcessor(moduleConfig, servletContext);
            if (log.isTraceEnabled()) {
                log.trace("Invoking request processor instance " + processor);
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

        MessageResources resources =
            (MessageResources) request.getAttribute(bundle);

        if (resources == null) {
            ModuleConfig moduleConfig =
                ModuleUtils.getInstance().getModuleConfig(request, application);

            resources =
                (MessageResources) application.getAttribute(bundle
                    + moduleConfig.getPrefix());
        }

        if (resources == null) {
            resources = (MessageResources) application.getAttribute(bundle);
        }
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

     * @return the ModuleConfig object specified, or null if not found in the
     *         context.
     */
    public ModuleConfig getModuleConfig(String prefix,
        HttpServletRequest request, ServletContext context) {
        ModuleConfig moduleConfig = null;

        if (prefix != null) {
            //lookup module stored with the given prefix.
            moduleConfig = this.getModuleConfig(prefix, context);
        } else {
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

     * @param context The ServletContext for this web application
     * @return the ModuleConfig object
     */
    public ModuleConfig getModuleConfig(HttpServletRequest request,
        ServletContext context) {
        ModuleConfig moduleConfig = this.getModuleConfig(request);

        if (moduleConfig == null) {
            moduleConfig = this.getModuleConfig("", context);
            request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        }
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

     * @param context The ServletContext for this web application
     */
    public void selectModule(String prefix, HttpServletRequest request,
        ServletContext context) {
        // Expose the resources for this module
        ModuleConfig config = getModuleConfig(prefix, context);

        if (config != null) {
            request.setAttribute(Globals.MODULE_KEY, config);

            MessageResourcesConfig[] mrConfig =
                config.findMessageResourcesConfigs();

            for (int i = 0; i < mrConfig.length; i++) {
                String key = mrConfig[i].getKey();
                MessageResources resources =
                    (MessageResources) context.getAttribute(key + prefix);
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

            if (multipartHandler != null) {
                return multipartHandler;
            }
        }

        ModuleConfig moduleConfig =
            ModuleUtils.getInstance().getModuleConfig(request);

        multipartClass = moduleConfig.getControllerConfig().getMultipartClass();

        // Try to initialize the global request handler
        if (multipartClass != null) {
            try {
                multipartHandler =
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

        if (pattern.endsWith("/*")) {
            sb.append(pattern.substring(0, pattern.length() - 2));
            sb.append(action.getPath());
        } else if (pattern.startsWith("*.")) {
            ModuleConfig appConfig =
                ModuleUtils.getInstance().getModuleConfig(request);

            sb.append(appConfig.getPrefix());
            sb.append(action.getPath());
            sb.append(pattern.substring(1));
        } else {
            throw new IllegalArgumentException(pattern);
        }
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.