Examples of ActionMapping


Examples of com.dotcms.repackage.org.apache.struts.action.ActionMapping

        //************************************************************
        //*****REGISTER THE ACTION REQUIRED BY THE STRUTS PORTLET*****
        //************************************************************
        //Creating an ActionMapping Instance
        ActionMapping actionMapping = new ActionMapping();

        //Configure the instance
        actionMapping.setPath( "/ext/strutshello/view_hello" );
        actionMapping.setType( "com.dotmarketing.osgi.portlet.HelloWorldAction" );

        //Create and register the forwards for this mapping
        registerActionForward( context, actionMapping, "portlet.ext.plugins.hello.world.struts", "/ext/strutshelloworld/view.jsp", false );
        registerActionForward( context, actionMapping, "portlet.ext.plugins.hello.world.struts.max", "/ext/strutshelloworld/view_hello.jsp", false );

View Full Code Here

Examples of com.opensymphony.webwork.dispatcher.mapper.ActionMapping

     *
     */
    @SuppressWarnings("unchecked")
    protected ActionInvocation invokeAction(DispatcherUtils du, HttpServletRequest request, HttpServletResponse response, ServletContext context, ActionDefinition actionDefinition, Map<String, String> params) throws ServletException
    {
        ActionMapping mapping = getActionMapping(actionDefinition, params);
        Map<String, Object> extraContext = du.createContextMap(request, response, mapping, context);

        // If there was a previous value stack, then create a new copy and pass it in to be used by the new Action
        OgnlValueStack stack = (OgnlValueStack) request.getAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY);
        if (null != stack)
        {
            extraContext.put(ActionContext.VALUE_STACK, new OgnlValueStack(stack));
        }

        try
        {
            prepareContinuationAction(request, extraContext);

            ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(actionDefinition.getNamespace(), actionDefinition.getAction(), extraContext, actionDefinition.isExecuteResult(), false);
            proxy.setMethod(actionDefinition.getMethod());
            request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, proxy.getInvocation().getStack());

            // if the ActionMapping says to go straight to a result, do it!
            if (mapping.getResult() != null)
            {
                Result result = mapping.getResult();
                result.execute(proxy.getInvocation());
            }
            else
            {
                proxy.execute();
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

    BasicDispatchController action = new BasicDispatchController();
    ActionForward actionForward = new ActionForward();

    SimpleDispatchAction actionBean = createMock(SimpleDispatchAction.class);
    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn("insert");
    expect(actionBean.insert()).andReturn("insertResult");
    expect(mapping.findForward("insertResult")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(request);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

    BasicDispatchController action = new BasicDispatchController();
    ActionForward actionForward = new ActionForward();

    SimpleDispatchAction actionBean = createMock(SimpleDispatchAction.class);
    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn(null);
    expect(actionBean.unspecified()).andReturn("unspecifiedResult");
    expect(mapping.findForward("unspecifiedResult")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(request);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  {

    BasicDispatchController action = new BasicDispatchController();

    SimpleDispatchAction actionBean = createMock(SimpleDispatchAction.class);
    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(mapping.getParameter()).andReturn(null);
    expect(mapping.getPath()).andReturn("path");

    replay(actionBean);
    replay(mapping);
    replay(request);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Test
  public void testCheckParamter()
  {

    ActionMapping actionMapping = createStrictMock(ActionMapping.class);
    expect(actionMapping.getPath()).andReturn("/path");

    replay(actionMapping);

    DispatchControllerHelper helper = new DispatchControllerHelper();
    try
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  public void testPopulateActionForm() throws Exception
  {
    ServletActionContext sac = getActionContext();
    FormPopulateSource formPopulateSource = newMock(FormPopulateSource.class);
    PopulateActionForm populateActionForm = getPopulateActionForm(formPopulateSource);
    ActionMapping actionConfig = newMock(ActionMapping.class);
    ActionForm actionForm = newMock(ActionForm.class);
    HttpServletRequest request = newMock(HttpServletRequest.class);

    expect(sac.getActionForm()).andReturn(actionForm);
    expect(sac.getRequest()).andReturn(request);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

    ServletActionContext sac = getActionContext();
    ControllerProcessorDelegate delegate = newMock(ControllerProcessorDelegate.class);
    ActionContextFactory factory = newMock(ActionContextFactory.class);
    ExecuteAction executeAction = getExecuteAction(delegate, factory);
    Action action = newMock(Action.class);
    ActionMapping actionConfig = newMock(ActionMapping.class);
    ActionForm actionForm = newMock(ActionForm.class);
    ActionContext actionContext = newMock(ActionContext.class);
    ActionForward forwardConfig = newMock(ActionForward.class);
    HttpServletRequest request = newMock(HttpServletRequest.class);
    HttpServletResponse response = newMock(HttpServletResponse.class);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Test
  public void testNavigationHandler()
  {

    ActionMapping mapping = createStrictMock(ActionMapping.class);

    ActionForward actionForward = new ActionForward();
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(mapping);

    MappingNavigationHandler handler = new MappingNavigationHandler();
    ActionForwardViewAdapter viewAdapter = handler.getActionForward(new TestContextImpl(null, mapping), "success");
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

    ActionForward actionForward = new ActionForward();

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    NavigableFormRenderBean actionBean = createStrictMock(NavigableFormRenderBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);

    ActionErrors errors = new ActionErrors();
    errors.add("prop", new ActionMessage("key"));
    expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(errors);
    actionBean.setInputError(true);
    actionBean.execute();
    expect(form.getBindOutwards()).andReturn(false);
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(form);
    replay(request);
View Full Code Here
TOP
Copyright © 2015 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.