Package org.apache.struts.action

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


  @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

  @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

  @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

  @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

      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

  @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

      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

             * the forms First try to find the panels action config. Look for
             * the same name as the panel id prefixed by a /
             */
            ActionConfig config = mapping.getModuleConfig().findActionConfig("/" + panel.getId());
            if (null != config && config instanceof ActionMapping) {
                ActionMapping subMapping = (ActionMapping) config;
                SubActionWrapper subActionWrapper = getSubActionWrapper(mapping, form, subMapping, request, index);
                if (null != subActionWrapper)
                    subActions.add(subActionWrapper);
            }
            index++;
View Full Code Here

     * @param parameterId
     * @param availableItem
     * @return String
     */
    public String getPath(String parameterId, AvailableTableItemAction availableItem) {
        ActionMapping attribute = (ActionMapping)availableItem.getRequest().getAttribute(Constants.REQ_ATTR_ACTION_MAPPING);
        String formattedPath = MessageFormat.format(requiredPath, new Object[] {parameterId, attribute.getName(), attribute.getPath()});
        return formattedPath;       
    }
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionMapping

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.