Discussion on request.getHeader of 'Referer'

  • 2020-06-12 10:16:37
  • OfStack

Today I would like to share 1, request. getHeader("Referer") to get the last visit to the URL link, when it will be a problem!
I have some buttons on some pages that I use to jump to action.do? method=m but I'm using
warpLoaction ("url"); This one links to the past, and it turns out, I'm in Firefox, it works
Gets the last page visited, but not under IE6. Went to baidu on the Net later 1, saw 1 elder brother's comment
request.getHeader("Referer") has value only if it goes through the HTTP protocol, which means it has to go through < a href="url" / >
To get the value. You can also submit it through the form. Via location or < a href="javascript:window.location=''" / > It's not worth it. Just do it right away. That was the reason. Hey hey.

Another one: messy code problem. If the link of ES29en. getHeader("Referer") has Chinese parameters, then it will appear when the jump. To code conversion! However, if the link is not via ES40en.getHeader ("Referer"), keyWords = new String(str.getBytes (" ES48en8859-1 "),"GBK"); To encode the conversion, can appear garbled, I am here to share how I solve under 1, first of all, I use str matches (" / \ \ u4E00 - \ \ u9FA5 + ") to determine whether the string is a Chinese, if there is no Chinese, compared to the code or number or English or other symbols, so we are encoding conversion, if it is in Chinese, is not to convert the code!

Related articles: