Package org.apache.struts.config

Examples of org.apache.struts.config.ApplicationConfig


    {
        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
       
        ActionMapping   mapping  = new ActionMapping();
        mapping.setName(ACTION_NAME);
        mapping.setPath(convertActionNameToPath(mapping.getName()));

        ActionFormBean  formBean =
            new ActionFormBean(mapping.getName(), FORM_BEAN_CLASS);

        appConfig.addActionConfig(mapping);
        appConfig.addFormBeanConfig(formBean);

        HttpServletResponse response   =
            (HttpServletResponse)pageContext.getResponse();

        String encodedURL  =
View Full Code Here


    {
        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
       
        ActionMapping   mapping  = new ActionMapping();
        mapping.setName(ACTION_NAME);
        mapping.setPath(convertActionNameToPath(mapping.getName()));

        ActionFormBean  formBean =
            new ActionFormBean(mapping.getName(), FORM_BEAN_CLASS);

        appConfig.addActionConfig(mapping);
        appConfig.addFormBeanConfig(formBean);

        HttpServletResponse response   =
            (HttpServletResponse)pageContext.getResponse();

        String encodedURL  =
View Full Code Here

        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);

        ActionForward   actionForward  = new ActionForward();
        actionForward.setName(FORWARD_VALUE);
        actionForward.setPath(PATH_VALUE);
        appConfig.addForwardConfig(actionForward);

        elFrameTag.setForward(FORWARD_VALUE);

        HttpServletResponse   response =
            (HttpServletResponse)pageContext.getResponse();
View Full Code Here

    protected String getActionMappingURL(String actionName) {

        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();
        StringBuffer value = new StringBuffer(request.getContextPath());
        ApplicationConfig config = (ApplicationConfig)
            pageContext.getRequest().getAttribute(Action.APPLICATION_KEY);
        if (config != null) {
            value.append(config.getPrefix());
        }

        // Use our servlet mapping, if one is specified
        String servletMapping = (String)
            pageContext.getAttribute(Action.SERVLET_KEY,
View Full Code Here

    {
        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
       
        ActionMapping   mapping  = new ActionMapping();
        mapping.setName(ACTION_NAME);
        mapping.setPath(convertActionNameToPath(mapping.getName()));

        ActionFormBean  formBean =
            new ActionFormBean(mapping.getName(), FORM_BEAN_CLASS);

        appConfig.addActionConfig(mapping);
        appConfig.addFormBeanConfig(formBean);

        HttpServletResponse response   =
            (HttpServletResponse)pageContext.getResponse();

        String encodedURL  =
View Full Code Here

    {
        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
       
        ActionMapping   mapping  = new ActionMapping();
        mapping.setName(ACTION_NAME);
        mapping.setPath(convertActionNameToPath(mapping.getName()));

        ActionFormBean  formBean =
            new ActionFormBean(mapping.getName(), FORM_BEAN_CLASS);

        appConfig.addActionConfig(mapping);
        appConfig.addFormBeanConfig(formBean);

        HttpServletResponse response   =
            (HttpServletResponse)pageContext.getResponse();

        String encodedURL  =
View Full Code Here

        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);

        ActionForward   actionForward  = new ActionForward();
        actionForward.setName(FORWARD_VALUE);
        actionForward.setPath(PATH_VALUE);
        appConfig.addForwardConfig(actionForward);

        elFrameTag.setForwardExpr(FORWARD_VALUE);

        HttpServletResponse   response =
            (HttpServletResponse)pageContext.getResponse();
View Full Code Here

        /* FIXME for Struts 1.2
           Since Struts 1.1 only has one implementation for
           ModuleConfig casting is safe here. Used only for
           transition purposes !
        */
        return new ApplicationConfig((ModuleConfigImpl)getModuleConfig(request));
    }
View Full Code Here

        /* FIXME for Struts 1.2
           Since Struts 1.1 only has one implementation for
           ModuleConfig casting is safe here. Used only for
           transition purposes !
        */
        return new ApplicationConfig((ModuleConfigImpl)initModuleConfig(prefix,path));
    }
View Full Code Here

    // Map to the default module -- direct
    public void testSelectApplication1a() {

        request.setPathElements("/myapp", "/noform.do", null, null);
        RequestUtils.selectApplication(request, context);
        ApplicationConfig appConfig = (ApplicationConfig)
            request.getAttribute(Globals.MODULE_KEY);
        assertNotNull("Selected an application", appConfig);
        assertEquals("Selected correct application",
                     "", appConfig.getPrefix());
        // FIXME - check application resources?

    }
View Full Code Here

TOP

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

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.