Examples of ActionMapping


Examples of org.apache.struts.action.ActionMapping

  {

    ActionForward actionForward = new ActionForward();

    NavigableFormSubmitBean actionBean = createStrictMock(NavigableFormSubmitBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    BasicActionForm form = createStrictMock(BasicActionForm.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(Boolean.TRUE);
    actionBean.cancel();
    expect(actionBean.getSuccessResult()).andReturn("cancel");
    expect(mapping.findForward("cancel")).andReturn(actionForward);

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

Examples of org.apache.struts.action.ActionMapping

    action.setNavigationHolder(navigationReader.getNavigationHolder());

    ActionForward actionForward = new ActionForward();

    NavigableReadOnlyBean actionBean = createMock(NavigableReadOnlyBean.class);
    ActionMapping mapping = createMock(ActionMapping.class);

    actionBean.execute();
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);

    ViewAdapter viewAdapter = action.executeAction(actionBean, new TestContextImpl(null, mapping));
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  void postExecute(ActionContext context)
  {
    ServletActionContext sc = (ServletActionContext) context;
   
    final HttpServletRequest request = sc.getRequest();
    final ActionMapping actionConfig = (ActionMapping) sc.getActionConfig();
    final Boolean formValid = context.getFormValid();
   
    formValidationHandler.postValidate(request, actionConfig, formValid);
  }
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Test
  public void testActionLogging()
  {

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

    // before execute
    expect(request.getRequestURI()).andReturn("uri");
    expect(mapping.getType()).andReturn("type");

    // after execute
    expect(request.getRequestURI()).andReturn("uri");

    replay(request);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Test
  public void testBasicProcessActionCreate() throws ServletException, IOException
  {

    ActionMapping mapping = createMock(ActionMapping.class);
    expect(mapping.getType()).andReturn(TestAction.class.getName()).times(2);

    replay(mapping);

    ControllerRequestProcessor controllerRequestProcessor = new ControllerRequestProcessor();
    controllerRequestProcessor.setActionCreator(new ActionCreatorImpl());
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Test
  public void testProcessActionCreateInteractions() throws Exception
  {

    ActionMapping mapping = createMock(ActionMapping.class);
    ActionCreatorImpl creator = createMock(ActionCreatorImpl.class);

    expect(mapping.getType()).andReturn(TestAction.class.getName());
    expect(creator.createAction(TestAction.class)).andReturn(new ReadOnlyControllerAction());
    expect(mapping.getType()).andReturn(TestAction.class.getName());

    replay(mapping);
    replay(creator);

    ControllerRequestProcessor controllerRequestProcessor = new ControllerRequestProcessor();
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Override
  protected ViewAdapter executeAction(Object actionBean, ActionContext context)
  {

    BasicDispatchAction action = (BasicDispatchAction) actionBean;
    ActionMapping mapping = context.getMapping();
    String parameterName = mapping.getParameter();

    helper.checkParameterName(mapping, parameterName);

    String methodName = getMethodName(context, parameterName);
    String result = null;
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

      BindingForm validBindingForm = (BindingForm) form;
      validBindingForm.bindInwards(actionBean);

    }

    ActionMapping mapping = context.getMapping();

    if (cancelled)
    {
      action.cancel();
    }
    else
    {

      // now figure out what method to execute and do so

      String parameterName = mapping.getParameter();

      getHelper().checkParameterName(mapping, parameterName);

      String methodName = getMethodName(context, parameterName);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

  @Override
  protected ViewAdapter executeAction(Object actionBean, ActionContext context)
  {

    NavigableDispatchAction action = (NavigableDispatchAction) actionBean;
    ActionMapping mapping = context.getMapping();
    String parameterName = mapping.getParameter();

    helper.checkParameterName(mapping, parameterName);

    String methodName = getMethodName(context, parameterName);
View Full Code Here

Examples of org.apache.struts.action.ActionMapping

      BindingForm validBindingForm = (BindingForm) form;
      validBindingForm.bindInwards(actionBean);

    }

    ActionMapping mapping = context.getMapping();
    String result = null;

    if (cancelled)
    {
      result = action.cancel();
    }
    else
    {

      // now figure out what method to execute and do so

      String parameterName = mapping.getParameter();

      getHelper().checkParameterName(mapping, parameterName);

      String methodName = getMethodName(context, parameterName);
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.