Examples of ActionResult


Examples of frwa.ActionResult

    public String getName() {
        return "MainFlight";
    }

    public ActionResult perform(HttpServletRequest request) {
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/MainFlight.jsp");
        actionResult.setFormObject(new FlightFormObject());
        return actionResult;
    }
View Full Code Here

Examples of frwa.ActionResult

            log.info("I catch an exception "+e);
        }
        Flight flight = factory.getFlightDAO().showInformation(trui);
        flight.setDepartureAirport(factory.getAirportDAO().loadCountryName(flight.getDepartureAirport()));
        flight.setDestinationAirport(factory.getAirportDAO().loadCountryName(flight.getDestinationAirport()));
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/ShowFlightInformation.jsp");
        if (flight!=null) {
            actionResult.setUrlAddress("/flt/ShowFlightInformation.jsp");
        } else {
            actionResult.setUrlAddress("flt/FlightNotFound.jsp");
        }
        FlightFormObject flightFormObject = new FlightFormObject();
        flightFormObject.setFlight(flight);
        actionResult.setFormObject(flightFormObject);
        return actionResult;
    }
View Full Code Here

Examples of frwa.ActionResult

        return "MainCountry";
    }

    @Override
    public ActionResult perform(HttpServletRequest request) {
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/MainCountry.jsp");
        actionResult.setFormObject(new FlightFormObject());
        return actionResult;
    }
View Full Code Here

Examples of gov.nara.nwts.ftapp.ActionResult

        types.put(key, stats);
        Matcher m = test(line);
        setVals(m, stats, line);
      }
      br.close();
      return new ActionResult(selectedFile, selectedFile.getName(), this.toString(), mydetails, types, true, timer.getDuration());
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return new ActionResult(selectedFile, selectedFile.getName(), this.toString(), mydetails, types, false, timer.getDuration());
  }
View Full Code Here

Examples of jodd.madvoc.result.ActionResult

   *
   * @see ActionResult#render(jodd.madvoc.ActionRequest, Object)
   */
  @SuppressWarnings("unchecked")
  public void render(ActionRequest actionRequest, Object resultObject) throws Exception {
    ActionResult actionResult;

    // [1] try to lookup the result class

    Class<? extends ActionResult> actionResultClass = null;

    if (resultObject != null && resultObject.getClass() != String.class) {
      // try annotation
      RenderWith renderWith = resultObject.getClass().getAnnotation(RenderWith.class);
      if (renderWith != null) {
        actionResultClass = renderWith.value();
      }
    } else if (resultObject == null) {
      Result result = actionRequest.getResult();
      if (result != null) {
        actionResultClass = result.getActionResult();
        resultObject = result.getResultValue();
        if (resultObject == null) {
          resultObject = result.value();
        }
      }
    }

    if (actionResultClass != null) {
      // result class is known, lookup the action result type
      actionResult = resultsManager.lookup(actionResultClass);

      if (actionResult == null) {
        // register action result if by any chance it wasn't registered yet
        actionResult = resultsManager.register(actionResultClass);
      }

    } else {
      // result class is not known, lookup it from returned string
      String resultValue = resultObject != null ? resultObject.toString() : null;
      String resultType = null;

      // first check result value
      if (resultValue != null) {
        int columnIndex = resultValue.indexOf(':');

        if (columnIndex != -1) {
          resultType = resultValue.substring(0, columnIndex);

          resultValue = resultValue.substring(columnIndex + 1);
        }
      }

      // result type still not defined, use default
      if (resultType == null) {
        resultType = madvocConfig.getDefaultResultType();
      }

      actionResult = resultsManager.lookup(resultType);
      if (actionResult == null) {
        throw new MadvocException("Action result not found: " + resultType);
      }

      // convert remaining of the string to result object
      try {
        Class targetClass = actionResult.getResultValueType();
        if (targetClass == String.class) {
          resultObject = resultValue;
        } else {
          resultObject = TypeConverterManager.convertType(resultValue, targetClass);
        }
      } catch (Exception ex) {
        resultObject = resultValue;
      }
    }

    // finally, invoke result
    if (madvocConfig.isPreventCaching()) {
      ServletUtil.preventCaching(actionRequest.getHttpServletResponse());
    }

    actionResult.render(actionRequest, resultObject);
  }
View Full Code Here

Examples of jodd.madvoc.result.ActionResult

    String resultType = result.getResultType();

    boolean existingResult = false;

    if (resultType != null) {
      ActionResult existing = lookup(resultType);
      if (existing != null) {
        Class<? extends ActionResult> resultClass = result.getClass();
        Class<? extends ActionResult> existingClass = existing.getClass();
        if (existingClass.equals(resultClass) == false) {
          // existing class is different from current class
          if (resultClass.getPackage().equals(ActionResult.class.getPackage())) {
            Class<? extends ActionResult> temp = existingClass;
            existingClass = resultClass;
View Full Code Here

Examples of org.apache.click.ActionResult

        save.addBehavior(new DefaultAjaxBehavior() {

            @Override
            public ActionResult onAction(Control source) {
                // Update the form which might contain errors
                return new ActionResult(form.toString(), ActionResult.HTML);
            }
        });

        cancel.addBehavior(new DefaultAjaxBehavior() {

            @Override
            public ActionResult onAction(Control source) {
                // Update the form and ensure errors and values have been cleared
                form.clearValues();
                form.clearErrors();
                return new ActionResult(form.toString(), ActionResult.HTML);
            }
        });

        // NOTE: we explicitly register the Form as an Ajax target so that the
        // Fom#onProcess method can be invoked. The save button's Behavior will
View Full Code Here

Examples of org.apache.click.ActionResult

        return form.onSubmitCheck(this, "/pageflow/invalid-submit.html");
    }

    // A pageAction that handles Ajax requests for a particular customer
    public ActionResult onChangeCustomer() {
        ActionResult actionResult = new ActionResult();

        // Lookup customer based on request parameter 'customerId'
        String customerId = getContext().getRequest().getParameter("customerId");
        Customer customer = customerService.findCustomerByID(customerId);

        // CustomerPanel will render the customer as an HTML snippet
        CustomerPanel customerPanel = new CustomerPanel(this, customer);
        actionResult.setContent(customerPanel.toString());

        // Set content type and character encoding
        actionResult.setCharacterEncoding("UTF-8");
        actionResult.setContentType(ActionResult.HTML);

        return actionResult;
    }
View Full Code Here

Examples of org.apache.click.ActionResult

    // Event Handlers ---------------------------------------------------------

    // A pageAction that handles Ajax requests for a particular customer
    public ActionResult onChangeCustomer() {
        ActionResult actionResult = new ActionResult();

        // Lookup customer based on request parameter 'customerId'
        String customerId = getContext().getRequest().getParameter("customerId");
        Customer customer = customerService.findCustomerByID(customerId);

        // CustomerPanel will render the customer as an HTML snippet
        CustomerPanel customerPanel = new CustomerPanel(this, customer);
        actionResult.setContent(customerPanel.toString());

        // Set content type and character encoding
        actionResult.setCharacterEncoding("UTF-8");
        actionResult.setContentType(ActionResult.HTML);

        return actionResult;
    }
View Full Code Here

Examples of org.apache.click.ActionResult

    protected Behavior createBehavior() {
        AjaxBehavior internalBehavior = new DefaultAjaxBehavior() {

            @Override
            public ActionResult onAction(Control source) {
                ActionResult actionResult = new ActionResult();

                String contentType = getPage().getContentType();
                actionResult.setContentType(contentType);

                List<?> autocompleteList = getAutoCompleteList(getValue());
                if (autocompleteList != null) {
                    HtmlStringBuffer buffer = new HtmlStringBuffer(10 + (autocompleteList.size() * 20));
                    renderAutoCompleteList(buffer, autocompleteList);
                    actionResult.setContent(buffer.toString());
                }
                return actionResult;
            }
        };

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.