Package com.adito.core

Examples of com.adito.core.MultiMap


             * LDP - Use the full URI with parameters as we need to ensure parameters are sent as they are received.
             */
      method = new ProxiedHttpMethod(requestProcessor.getWebForward().getFormType(),
          SessionInfoReplacer.replace(requestProcessor.getSessionInfo(),
          requestProcessor.getUriEncoded()),
          requestProcessor.getWebForward().getFormType().equals(WebForwardTypes.FORM_SUBMIT_POST)? new MultiMap() : requestParameters,
          requestProcessor.getSessionInfo(),
          requestProcessor.getWebForward().getFormType().equals(WebForwardTypes.FORM_SUBMIT_POST));

      if (requestProcessor.getWebForward().getEncoding() != null && !requestProcessor.getWebForward().getEncoding().equals(WebForwardTypes.DEFAULT_ENCODING))
                method.setCharsetEncoding(requestProcessor.getWebForward().getEncoding());
View Full Code Here


       * This code will automatically submit form parameters. If it is a post,
       * then we ignore the parameters request and use the webforward target.
       */
      method = new ProxiedHttpMethod(webForward.getFormType(),
              target.getFile(),
              webForward.getFormType().equals(WebForwardTypes.FORM_SUBMIT_POST) new MultiMap() : new MultiMap(request.getParameters()),
              launchSession.getSession(),
              webForward.getFormType().equals(WebForwardTypes.FORM_SUBMIT_POST));

      if (webForward.getCharset() != null
          && !webForward.getCharset().equals("")
          && !webForward.getCharset().equals(WebForwardTypes.DEFAULT_ENCODING))
        method.setCharsetEncoding(webForward.getCharset());

      StringTokenizer tokens = new StringTokenizer(webForward.getFormParameters(), "\n");
      int idx;
      String param;
     
      while (tokens.hasMoreTokens()) {
        param = v.replace(tokens.nextToken().trim());
        idx = param.indexOf('=');
        if (idx > -1) {
          method.addParameter(param.substring(0, idx), param.substring(idx + 1));
        } else
          method.addParameter(param, "");
      }
     
      launchSession.setAttribute(LAUNCH_ATTR_AUTH_POSTED, Boolean.TRUE);
      processRequestHeaders(request, method);
     
      // Do not send through any cookies on the authentication request
      method.getProxiedRequest().removeFields(HttpConstants.HDR_COOKIE);
      client.removeAllCookies();

    } else {
      method = new ProxiedHttpMethod(request.getMethod(),
              request.getURIEncoded(),
              new MultiMap(request.getParameters()),
              launchSession.getSession(),
              request.getContentType() != null && request.getContentType()
                      .toLowerCase()
                      .startsWith("application/x-www-form-urlencoded"));
      if (webForward.getCharset() != null
View Full Code Here

       
        cookies = wrapping.getCookies();
        characterEncoding = wrapping.getCharacterEncoding();
        authType = wrapping.getAuthType();
        headerNames = new Vector<String>();
        headers = new MultiMap();
        for(Enumeration e = wrapping.getHeaderNames();
            e.hasMoreElements(); ) {
            String headerName = (String)e.nextElement();
            for(Enumeration f = wrapping.getHeaders(headerName); f.hasMoreElements(); ) {
                String headerValue = (String)f.nextElement();               
View Full Code Here

    }
    }
   
   
    public MultiMap getURIParameters() {
      MultiMap output = new MultiMap();
      StringTokenizer tokens = new StringTokenizer(getOriginalURIParameters(), "&");
      int idx;
      String name;
      while(tokens.hasMoreTokens()) {
        name = tokens.nextToken();
        idx = name.indexOf('=');
        if(idx > -1) {
           output.add(URLUTF8Encoder.decode(name.substring(0, idx)), URLUTF8Encoder.decode(name.substring(idx+1)));
        } else {
           output.add(URLUTF8Encoder.decode(name), "");
        }
      }
      return output;
    }
View Full Code Here

TOP

Related Classes of com.adito.core.MultiMap

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.