Package com.struts2.gae.dispatcher

Examples of com.struts2.gae.dispatcher.GaeDispatcher


        for ( Iterator e = filterConfig.getInitParameterNames(); e.hasNext(); ) {
            String name = (String) e.next();
            String value = filterConfig.getInitParameter(name);
            params.put(name, value);
        }
        return new GaeDispatcher(filterConfig.getServletContext(), params);
    }
View Full Code Here


    }

    String content_type = request.getContentType();
    if (content_type != null
        && content_type.indexOf("multipart/form-data") != -1) {
      GaeMultiPartRequest multi = getContainer().inject(
          GaeMultiPartRequest.class);
      request = new GaeMultiPartRequestWrapper(multi, request);
    } else {
      request = new StrutsRequestWrapper(request);
    }
View Full Code Here

    String content_type = request.getContentType();
    if (content_type != null
        && content_type.indexOf("multipart/form-data") != -1) {
      GaeMultiPartRequest multi = getContainer().inject(
          GaeMultiPartRequest.class);
      request = new GaeMultiPartRequestWrapper(multi, request);
    } else {
      request = new StrutsRequestWrapper(request);
    }

    return request;
View Full Code Here

    if (action instanceof ValidationAware) {
      validation = (ValidationAware) action;
    }

    GaeMultiPartRequestWrapper multiWrapper = (GaeMultiPartRequestWrapper) request;

    if (multiWrapper.hasErrors()) {
      for (String error : multiWrapper.getErrors()) {
        if (validation != null) {
          validation.addActionError(error);
        }

        LOG.error(error);
      }
    }

    // bind allowed Files
    Enumeration<String> fileParameterNames = multiWrapper
        .getFileParameterNames();
    while (fileParameterNames != null
        && fileParameterNames.hasMoreElements()) {
      // get the value of this input tag
      String inputName = fileParameterNames.nextElement();

      // get the content type
      String[] contentType = multiWrapper.getContentTypes(inputName);

      if (isNonEmpty(contentType)) {
        // get the name of the file from the input tag
        String[] fileName = multiWrapper.getFileNames(inputName);

        if (isNonEmpty(fileName)) {

          String[] fileItemStreams = multiWrapper
              .getFileContents(inputName);
          // get a File object for the uploaded File
          if (fileItemStreams != null && fileItemStreams.length > 0) {
            List<String> acceptedFiles = new ArrayList<String>(
                fileItemStreams.length);
View Full Code Here

TOP

Related Classes of com.struts2.gae.dispatcher.GaeDispatcher

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.