Package org.strecks.action

Examples of org.strecks.action.BasicFormAction


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

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

    expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(null);
    actionBean.setInputError(false);
    form.setBindOutwards(true);
    expect(actionBean.execute()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);
    expect(form.getBindOutwards()).andReturn(true);
    form.bindOutwards(actionBean);

    replay(actionBean);
View Full Code Here


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

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    BasicFormAction actionBean = createStrictMock(BasicFormAction.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);
    expect(actionBean.execute()).andReturn("success");
    expect(form.getBindOutwards()).andReturn(false);
    expect(mapping.findForward("success")).andReturn(actionForward);

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

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

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

    expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(null);
    actionBean.setInputError(false);
    expect(actionBean.execute()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

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

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

    BasicFormAction action = (BasicFormAction) actionBean;

    ActionForm form = context.getForm();

    boolean hasErrors = hasErrors(context);
    action.setInputError(hasErrors);
   
    if (form instanceof BindingForm && !hasErrors)
    {
      BindingForm bindingForm = (BindingForm) form;
      bindingForm.setBindOutwards(true);
    }

    String result = action.execute();

    if (form instanceof BindingForm)
    {
      BindingForm validBindingForm = (BindingForm) form;
View Full Code Here

TOP

Related Classes of org.strecks.action.BasicFormAction

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.