Package org.w3c.www.http

Examples of org.w3c.www.http.HttpAcceptLanguage


      for (int i = 0 ; i < states.size() ; i++) {
    VariantState state = (VariantState) states.elementAt(i) ;
    state.setLanguageQuality (1.0) ;
      }
  } else {
      HttpAcceptLanguage languages[] = request.getAcceptLanguage() ;
      LanguageTag req_lang[] = new LanguageTag[languages.length];
      for (int i = 0 ; i < languages.length ; i++) {
    req_lang[i] = new LanguageTag(languages[i].getLanguage());
      }
      boolean  varyLang    = false ;
View Full Code Here


     *
     * @return an <code>Enumeration</code> of preferred
     * <code>Locale</code> objects for the client
     */
    public Enumeration getLocales() {
  HttpAcceptLanguage languages[] = request.getAcceptLanguage();
  if (languages == null) {
      Vector def = new Vector();
            def.addElement(Locale.getDefault());
            return def.elements();
  }

  //LinkedList is better, but we must be JDK1.1 compliant
  Vector locales = new Vector();

  for (int i = 0 ; i < languages.length ; i++) {
      HttpAcceptLanguage language = languages[i];
      double quality = language.getQuality();
      String lang    = language.getLanguage();
      String country = "";
      int    idx     = lang.indexOf('-');
      if (idx > -1) {
    country = lang.substring(idx + 1).trim();
    lang    = lang.substring(0, idx).trim();
View Full Code Here

TOP

Related Classes of org.w3c.www.http.HttpAcceptLanguage

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.