Get Ip Addr. From The HttpServletRequest Wrapped By The "iisforward" ISAPI Extension In Weblogic | 通过iisforward isapi ext访问weblogic的取ip问题 [Permalink]
Sun Oct 02 12:46:42 CST 2005
在IIS+Weblogic整合系统中,像移动网关一样,iisforward这个ISAPI过滤器也会对request对象进行再包装,附加一些WLS要用的头信息。这种情况下,直接用request.getRemoteAddr()是无法取到真正的客户IP的。
实际的iisforward附加头如下:
WL-Proxy-Client-IP=211.161.1.239 Proxy-Client-IP=211.161.1.239 X-Forwarded-For=211.161.1.239 WL-Proxy-Client-Keysize= WL-Proxy-Client-Secretkeysize= X-WebLogic-Request-ClusterInfo=true X-WebLogic-KeepAliveSecs=30 X-WebLogic-Force-JVMID=-327089098 WL-Proxy-SSL=false综上,正确作法如下:
public String getIpAddr(HttpServletRequest request) {
String ip=request.getHeader("X-Forwarded-For");
if(ip == null || ip.length() == 0) {
ip=request.getHeader("Proxy-Client-IP");
}
if(ip == null || ip.length() == 0) {
ip=request.getHeader("WL-Proxy-Client-IP");
}
if(ip == null || ip.length() == 0) {
ip=request.getRemoteAddr();
}
return ip;
}
如此一来,就可适应各种情况,包括通过移动网关访问(会附加X-Forwarded-For)。通过这个简单例子可以看出封装和抽象的重要性。
Posted by: miles
Comments on this entry
phentermine buy phentermine cheap phentermine online phentermine phentermine online phentermine diet pill diet phentermine pill buy phentermine online buy online phentermine order phentermine phentermine prescription phentermine no prescription no phentermine prescription order phentermine online pharmacy phentermine phentermine pharmacy phentermine adipex adipex phentermine phentermine cheap discount discount phentermine phentermine pill purchase phentermine cash delivery phentermine phentermine cash on delivery cash delivery phentermine poll phentermine 37.5 37.5 phentermine xenical hgh phentermine quit smoking detox phentermine diet diet phentermine 37.5 mg phentermine 37,5 mg phentermine herbal phentermine phentermine on line online pharmacy phentermine phentermine online pharmacy 37.5mg phentermine hcl phentermine phentermine hcl drug buy no phentermine prescription prescription buy phentermine no prescription buy no phentermine prescription online phentermine prescription phentermine prescription online adipex medication phentermine phentermine cheap no prescription cheap no phentermine prescription no prescription needed phentermine needed no phentermine prescription custom health hrt phentermine phentermine by consolidation debt phentermine popl powere adipex fastin p phentermine where to buy phentermine buy phentermine where where to buy phentermine online adipex ionamin phentermine online pharmacy phentermine cod cod online pharmacy phentermine phentermine for sale online phentermine sale phentermine sale type of phentermine phentermine weight loss result loss phentermine weight phentermine weight loss cheap phentermine online cheap online phentermine phentermine review how does phentermine work does phentermine work hycrococone phentermine phentermine online purchase online phentermine purchase blog herbal hoodia phentermine herbal hoodia phentermine 37.5 cheap no phentermine prescription phentermine 37.5 no prescription 37.5 no phentermine prescription buy 30mg phentermine adipex drug phentermine vs adipex phentermine vs celexa phentermine buy line phentermine buy phentermine on line 37 5mg cheap phentermine phentermine online diet pill direct order phentermine direct phentermine phentermine picture pill phentermine 37.5mg tablet cheapest online phentermine cheapest phentermine online phentermine sales buying phentermine phentermine buying buying phentermine online diet drug phentermine pill search phentermine adipex search phentermine phentermine search obtain online phentermine prescription lowest phentermine price purchase buy phentermine diet pill online buy phentermine diet pill lowest phentermine price phentermine phentermine buy phentermine utc wiki buy phentermine wiki phentermine online pharmacy canada canada online pharmacy phentermine buy phentermine 37.5 37.5 90 phentermine phentermine online doctor 1 30mg buy phentermine blog buy phentermine phentermine prescription line does herbal phentermine work phentermine legal online canadian pharmacy phentermine online order phentermine prescription meridia cheap meridia buy meridia meridia online meridia weight loss discount meridia generic meridia meridia online pharmacy phentermine xenical meridia diet pill order meridia online meridia attorney meridia coupon coupon meridia loss meridia review weight meridia success story euclid hospital meridia how does meridia work meridia diet drug meridia weight loss drug buy meridia online buy cheap meridia meridia order meridia ups meridia pill cheapest meridia adipex hoodia meridia phentermine meridia diet meridia information meridia 10mg buy free low meridia price shipping meridia prescription adipex meridia phentermine xenical meridia effectiveness meridia testimonials order meridia cheap meridia phentermine meridia wellbutrin coupon discount meridia meridia success meridia prozac loss medication meridia weight sibutramine generic meridia dose effects meridia side alabama legal meridia florida legal meridia purchase meridia online low cost meridia meridia cod buy meridia mg california legal meridia arizona legal meridia adipex vs meridia effects meridia sibutramine side side effects diet pill meridia diet effects meridia pill side cheap meridia paris meridia vs xenical breckenridge lawyer meridia adipex buy meridia book booker cheap com guest site tramadol book boyd cheap com guest site tramadol book brain buy guest ru site tramadol book britney cheap com guest site tramadol book burning buy by gold optionen powered tramadol book burt buy com guest site tramadol book burt cheap com guest site tramadol book buy ca discount guest site tramadol book buy celeste com guest site tramadol book buy ch discount guest site tramadol book buy cheap guest site tramadol book buy cheri com guest site tramadol book buy christian guest ru site tramadol book buy christie com guest site tramadol book buy clarence com guest site tramadol book buy clement com guest site tramadol book buy clifford com guest site tramadol book buy cn discount guest site tramadol book buy com cristina guest site tramadol book buy com dale guest site tramadol book buy com derrick guest site tramadol book buy com desmond guest site tramadol book buy com discount guest site tramadol book buy com dorian guest site tramadol book buy com dwight guest site tramadol book buy com ebony guest site tramadol book buy com eldon guest site tramadol book buy com elisa guest site tramadol book buy com emery guest site tramadol book buy com emile guest site tramadol book buy com emory guest site tramadol book buy com esmeralda guest site tramadol book buy com esther guest site tramadol book buy com faith guest site tramadol book buy com fidel guest site tramadol book buy com frederic guest site tramadol book buy com gale guest site tramadol book buy com guest guy site tramadol book buy com guest heather site tramadol book buy com guest isaiah site tramadol book buy com guest karina site tramadol book buy com guest kris site tramadol book buy com guest lacey site tramadol book buy com guest leila site tramadol book buy com guest minerva site tramadol book buy com guest myron site tramadol book buy com guest rena site tramadol book buy com guest rick site tramadol book buy com guest saul site tramadol book buy com guest scot site tramadol book buy com guest site sylvester tramadol book buy de discount guest site tramadol book buy discount dk guest site tramadol book buy discount guest info site tramadol book buy discount guest it site tramadol book buy discount guest net site tramadol book buy discount guest nl site tramadol book buy discount guest org site tramadol book buy discount guest pl site tramadol book buy discount guest ru site tramadol book buy discount guest site tramadol book buy discount guest site tramadol tw book buy guest now site tramadol book buy guest online php tramadol view book buy guest online purple tramadol yin book buy guest online sign tramadol book buy guest online tramadol view book buy guest php tramadol view book buy guest purple tramadol yin book buy guest sign tramadol book buy guest tramadol view book carmen cheap com guest site tramadol book carmen com guest site tramadol book cecil cheap com guest site tramadol book cheap christian com guest site tramadol book cheap christie com guest site tramadol book cheap clare com guest site tramadol book cheap clarence com guest site tramadol book cheap com cristina guest site tramadol book cheap com dale guest site tramadol book cheap com dorian guest site tramadol book cheap com eddy guest site tramadol book cheap com eduardo guest site tramadol book cheap com elias guest site tramadol book cheap com emmett guest site tramadol book cheap com ernie guest site tramadol book cheap com erwin guest site tramadol book cheap com ester guest site tramadol book cheap com esther guest site tramadol book cheap com felicia guest site tramadol book cheap com guest helene site tramadol book cheap com guest hubert site tramadol book cheap com guest iva site tramadol book cheap com guest jarvis site tramadol book cheap com guest javier site tramadol book cheap com guest jimmie site tramadol book cheap com guest jo site tramadol book cheap com guest jodi site tramadol book cheap com guest juanita site tramadol book cheap com guest jules site tramadol book cheap com guest katy site tramadol book cheap com guest kelsey site tramadol book cheap com guest lacy site tramadol book cheap com guest lilly site tramadol book cheap com guest lina site tramadol book cheap com guest lonnie site tramadol book cheap com guest madeline site tramadol book cheap com guest marquis site tramadol book cheap com guest merlin site tramadol book cheap com guest merrill site tramadol book cheap com guest micah site tramadol book cheap com guest myron site tramadol book cheap com guest nestor site tramadol book cheap com guest nolan site tramadol book cheap com guest patsy site tramadol book cheap com guest quincy site tramadol book cheap com guest quinton site tramadol book cheap com guest ramona site tramadol book cheap com guest rosemary site tramadol book cheap com guest salvatore site tramadol book cheap com guest saul site tramadol book cheap com guest site tramadol trina book cheap guest john ru site tramadol buy cheap tramadol hydrochloride ultram buy here tramadol cheap cod fre tramadol cod pay tramadol cod pharmacy tramadol drug hydrochloride risk tramadol drug information keyword tramadol drug information medline plus tramadol drug interactions tramadol elavil drug testing and tramadol drug tramadol price list hcl mg tramadol hydrochloride tablet tramadol hydrocodone mexican pharmacy what is tramadol ic tramadol hcl purchase tramadol hydrochloride tramadol hcl aceaminophen tramadol hcl effects tramadol hydrochloride ac tramadol hydrochloride cod tramadol hydrochloride description tramadol hydrochloride dose tramadol hydrochloride effects tramadol hydrochloride overdose tramadol hydrochloride uk tramadol is tramadol is a tramadol medicine online tramadol online tramadol online medication tramadol order by 3 00 pm online adipex phentermine prescriptions online consultation phentermine online consultations and prescriptions phentermine online order phentermine online order phentermine price online page phentermine online pharmacies phentermine xenical meridia online pharmacy and phentermine online phentermine physician online phentermine prescription online phentermine rx online phentermine rx withou online phentermine store bontril phentermine book buy com guest ida online phentermine site book buy com guest kerry phentermine site book buy com guest lora online phentermine site book buy com guest minerva online phentermine site book buy com guest number online phentermine site book buy com guest online patsy phentermine site book buy com guest online phentermine site tasha book buy com guest online phentermine shari site book buy com guest online phentermine site willa book buy com guest phentermine prozac site book buy com guest phentermine rochelle site book buy com guest phentermine sherri site phentermine and soma online pharmacy