Package org.apache.struts.config

Examples of org.apache.struts.config.ActionConfig


        log.debug(ct + " assertions run in this test");
    }

    public void testString_getActionMappingURL_String_PageContext() {
        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/myapp", "/foo.do", null, null);
View Full Code Here


    // use servlet mapping (extension mapping)
    public void testString_getActionMappingURL_String_String_PageContext_boolean1() {
        pageContext.getServletContext().setAttribute(Globals.SERVLET_KEY, "*.do");

        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/myapp", "/baz.do", null, null);

View Full Code Here

    // use servlet mapping (extension mapping)
    //  -- with params
    public void testString_getActionMappingURL_String_String_PageContext_boolean2() {
        pageContext.getServletContext().setAttribute(Globals.SERVLET_KEY, "*.do");

        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/myapp", "/baz.do?foo=bar", null, null);

View Full Code Here

    //  -- path as "/"
    // (this is probably not a realistic use case)
    public void testString_getActionMappingURL_String_String_PageContext_boolean3() {
        pageContext.getServletContext().setAttribute(Globals.SERVLET_KEY, "*.do");

        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/mycontext", "/baz", null, null);

View Full Code Here

    // use servlet mapping (path mapping)
    public void testString_getActionMappingURL_String_String_PageContext_boolean4() {
        pageContext.getServletContext().setAttribute(Globals.SERVLET_KEY,
            "/myapp/*");

        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/mycontext", "/baz", null, null);

View Full Code Here

    //  -- with params
    public void testString_getActionMappingURL_String_String_PageContext_boolean5() {
        pageContext.getServletContext().setAttribute(Globals.SERVLET_KEY,
            "/myapp/*");

        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/mycontext", "/baz?foo=bar", null, null);

View Full Code Here

    // use servlet mapping (path mapping)
    //  -- using "/" as mapping
    public void testString_getActionMappingURL_String_String_PageContext_boolean6() {
        pageContext.getServletContext().setAttribute(Globals.SERVLET_KEY, "/");

        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setParameter("/foo");
        moduleConfig.addActionConfig(actionConfig);

        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/mycontext", "/baz", null, null);
View Full Code Here

     */
    public static ActionForm getActionForm(HttpServletRequest request,
                                           HttpSession session)
    {
        /* Is there a mapping associated with this request? */
        ActionConfig mapping =
            (ActionConfig)request.getAttribute(Globals.MAPPING_KEY);
        if (mapping == null)
        {
            return null;
        }

        /* Is there a form bean associated with this mapping? */
        String attribute = mapping.getAttribute();
        if (attribute == null)
        {
            return null;
        }

        /* Look up the existing form bean */
        if ("request".equals(mapping.getScope()))
        {
            return (ActionForm)request.getAttribute(attribute);
        }
        if (session != null)
        {
View Full Code Here

     */
    public static String getActionFormName(HttpServletRequest request,
                                           HttpSession session)
    {
        /* Is there a mapping associated with this request? */
        ActionConfig mapping =
            (ActionConfig)request.getAttribute(Globals.MAPPING_KEY);
        if (mapping == null)
        {
            return null;
        }

        return mapping.getAttribute();
    }
View Full Code Here

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

TOP

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

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.