Q(Quality Values)的意思是客户端用户对语言的偏好值,范围0-1,默认是1。
http 1.1中小数点后最多能有三位:
qvalue = ( "0" [ "." 0*3DIGIT ] ) | ( "1" [ "." 0*3("0") ] )
-----------------------------------
HTTP content negotiation (section 12) uses short "floating point" numbers to indicate the relative importance ("weight") of various negotiable parameters. A weight is normalized to a real number in the range 0 through 1, where 0 is the minimum and 1 the maximum value. If a parameter has a quality value of 0, then content with this parameter is `not acceptable' for the client. HTTP/1.1 applications MUST NOT generate more than three digits after the decimal point. User configuration of these values SHOULD also be limited in this fashion.       qvalue         = ( "0" [ "." 0*3DIGIT ] )
                      | ( "1" [ "." 0*3("0") ] )"Quality values" is a misnomer, since these values merely represent relative degradation in desired quality. 例如你列出来的值意思是:
默认接受af-za(南非荷兰语)、af(荷兰语),其它语言按值大小表示可接受程度。

解决方案 »

  1.   

    Sorry,忘了回答如何读取q最大的值对应的语言。
    很明显,就是前两个值为1的语言。
      

  2.   

    多谢2楼的回答,这几天到处查了下,自己感觉是这样的:以Accept-Language:af-za,af;q=0.8,en-za;q=0.7,en-gb;q=0.5,en-us;q=0.3,en;q=0.2为例,
    实际是默认每种语言用","分隔,第一个"af-za"是默认q=1的,然后其他","之间的用q的值来区别优先程度。多语言情况下需要区分的时候,可以用request.getLocale().getLanguage来返回首选地域选项(返回值是zh,en,ja等)。