Let me share with you today, request. getHeader ("Referer") gets the URL link of the last visit, and under what circumstances will it cause problems!
On some pages, how many buttons can be used to jump to action. do? Method = m. However, I use
WarpLoaction ("url"); this links to the past. As a result, I can use the Firefox browser correctly.
Obtain the last accessed page, but cannot obtain it in IE6. Later, I went to Baidu and saw a comment from yige.
Request. getHeader ("Referer") must follow the HTTP protocol to obtain a value, that is, the request must pass <a href = "url"/>
To obtain the value. Of course, you can also submit it through a form. However, if location or <a href = "javascript: window. location ='' "/> is used, the value is not obtained. That's the reason. Hey.
Another problem is garbled. If the request. if the getHeader ("Referer") Link contains a Chinese parameter, garbled characters will appear during the jump. In this case, String keyWords = new String (str. getBytes ("ISO-8859-1"), "GBK"); to encode conversion! However, if the request is not passed. keyWords = new String (str. getBytes ("ISO-8859-1"), "GBK"); to encode the conversion, it will appear garbled, I am here to share how I solve, first of all, I use str. matches ("[\ u4E00-\ u9FA5] +") to determine whether the string contains Chinese characters. If there is no Chinese character, it is garbled characters, numbers, English letters, or other symbols, then we will perform encoding conversion. If it is Chinese, no encoding conversion will be performed!