Cannot getRemoteAddr through WebCache

I use the command request.getRemoteAddr() to get the client's IP address which works only when hitting the port 7778 of the application server. When hitting port 80 (of the Oracle WebCache), the command returns the IP of the server host (which is natural since the web cache is now the client for the application server).
Does anybody know what I can do?
Thanx in advance
Lambros

There is actually a way to find the original client's ip.
It is true that the client ip is substituted with the Web Cache ip, but the Web Cache stores the original ip-address in the header request as "CLIENTIP".
If you want your application to fetch the correct ip in request.getRemoteAddr(), you could write a servlet filter that wraps the HttpServletRequest with a new class that returns the correct ip.
Example:
public class IpChangeFilter implements Filter {
public void doFilter( ServletRequest pRequest, ServletResponse pResponse, FilterChain pChain) throws IOException, ServletException {
if( pRequest instanceof HttpServletRequest)
pChain.doFilter( new IpChangeRequest( (HttpServletRequest)pRequest), pResponse);
else
pChain.doFilter( pRequest, pResponse);
And the wrapper:
private class IpChangeRequest extends HttpServletRequestWrapper {
public String getRemoteAddr() {
String tNewIp = getHeader( "CLIENTIP");
if( tNewIp==null || tNewIp.length()==0)
tNewIp = super.getRemoteAddr();
return tNewIp;
public int getServerPort() {
if( super.getServerPort()==7778)
return 80;
else
return super.getServerPort();
Hope this helps!
-Glenn

Similar Messages

  • I bought my ipad in us, and has been using a purchasing applications. Now i already went back to bahrain, i am trying to purchase apllication using my bahrain credit card but it cannot get through as the default country is USA.   I tried

    I bought my ipad in us, and has been using a pre paid card in purchasing applications. Now i already went back to bahrain, i am trying to purchase apllication using my bahrain credit card but it cannot get through as the default country is USA.
    I tried to change my country but a message says i have a store credit balance and must spend it before changing store. But how i can spend it i only have 8 cents left?
    So how will i be able to purchase applications if i am in bahrain?

    You can try again after a few hours after waiting and you still get the same error, you'll need to contact support.
    https://expresslane.apple.com/GetproductgroupList.action

  • Cannot swipe through different pages in the app store

    As stated above I cannot swipe through different pages in the app store. It shows the first 12 apps (out of 2000) their is no ability to swipe to see the other apps.
    I'm using an ipad 2 and I've tried resetting and completely erasing the ipad w/no luck

    Where on the screen are you swiping ? I can swipe on the screen where the apps are (either to the right or upwards depending upon the iOS version) and it then displays the next set of apps.

  • Unable to find a Re-Seller willing to sell me an Upgrade from Acrobat 9-Pro to XI. Live in Puerto Rico. Cannot buy through the Adobe Website. Locally identified Re-Seller unable/unwilling to provide me with the advertised Upgrade. My Options are; please?

    Unable to find a Re-Seller willing to sell me an Upgrade from Acrobat 9-Pro to XI. Live in Puerto Rico. Cannot buy through the Adobe Website. Locally identified Re-Seller unable/unwilling to provide me with the advertised Upgrade. My Options are; please?

    Reason I had to chat with Customer Support is that I got the following message upon placing Upgrade Order.
    What Different Country? It's the US. The ONLY placed I've lived my entire life! Apparently some software changes were made to the site and the PR Territory fell in a no-man's land.

  • Cannot record through line-in in bootcamp MBP late summer '09 model

    cannot record through line-in in bootcamp MBP late summer '09 model
    audio source (mp3 player) <3.5mm male input-------------3.5mm male input>  line-in to macbook pro late summer 2009 model bootcamp windows xp sp2
    when i select microphone in the audio panel - it works
    when i select line-in and plug in the 3.5mm jack input to 3.5mm jack input to a fm radio for ex. it doesn't work
    how do i make the line-in work?
    i remember that when i first installed mac osx sl and windows xp bootcamp - the first couple of times around when partitioning the hd - the line-in worked a couple of times, in between times somewhere along the line i made some change to the spdif settings ?? or driver / to make the red light that comes on in the line-in jack go away -  the other method was to use a toothpick to push a tiny button inside the jack, did that once -but the redlight came back again after a restart on bootcamp side.
    thanks in advance,
    -r

    Although I don't use it, the Line-Input jack should require a signal about 40dB higher than what a microphone alone puts out. If your cable only adapts the connector and does not provide amplification, I'm not surprised you get nothing. If you are lucky, you MIGHT get a low signal by going into System Prefs/Sound/input/line-in and turning the input level slider all the way up. But the real answer to to get a mike preamp or mixer, or a mike with line-level output. Some products take a mike input and convert it to digital into the USB port.

  • Cannot browse through bookstore by title

    I cannot browse through the bookstore by book title. I only see an author list, which is not really usefull. Untl now, I haven't found a function how to switch between author and title view.
    I own a iPhone 4S with the latest iOS version. On my iPad I can browse by title.
    kr
    Michael

    Just to update, don't know for what reason now I'm able to access the internet thru proxy after establish the VPN connection to my office.
    I did not change any setting at all and suddenly able to access thru proxy but I just can't ping the proxy server ip, the rest server ip I'm able to ping...strange...

  • The ios7 is not updating through the computer and when it get half way it says that there is an error. I cannot try through wifi because I don't have the software update tab. If anyone could help it would be good.

    Doesnot work through the computer
    Cannot update through wifi
    There is an error everytime it updated through the computer

    Hello there, Adele102.
    The following Knowledge Base article offers up some great steps for resolving the issue you're describing:
    Resolve iOS update and restore errors in iTunes
    http://support.apple.com/kb/ts1275
    If the issue persists, then this article provides an extensive list of error messages and additional troubleshooting steps:
    Resolve specific iTunes update and restore errors
    http://support.apple.com/kb/ts3694
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • HI, I just bought an iPhone 4S. Although my iPad and other iPhone 3GS connect to our server (SBS2003) I cannot get through.  It checks all items in the connection and then I get the message :Cannot get mail, the connection to the server failed."

    HI, I just bought an iPhone 4S. Although my iPad and other iPhone 3GS connect to our server (SBS2003) I cannot get through.  It checks all items in the connection and then I get the message :Cannot get mail, the connection to the server failed."  I Tried everything, rebooting, reset all iPhone, etc.  All Apple devices work perfectly expect mine.  Please advise

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    On your iPad go to Settings > General > Reset > Reset network settings and see if that enables you to connect.
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
     Cheers, Tom

  • Post Moved Cannot-connect-through-anonymous-prox...

    Post moved to Other BB Queries  http://community.bt.com/t5/Other-BB-Queries/Cannot-connect-through-anonymous-proxy/td-p/650446
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

    You could try reading about wingates, socks and proxies (oh before i forget, turn off java, javascript, cookies, what's related, and smart update ... if you are using IE you're not very smart). Also try installing a firewall, or DHCP or you can learn from me!Here is the info of best 10 proxy software, from which you may try: http://www.techyv.com/article/top-10-free-proxy-software

  • Equium L40 - cannot connect through wifi or the ubs lead plugged in

    Hi
    I have a Equium L40. I cannot connect through wifi or the ubs lead plugged in.
    It comes up " Internet Explorer has stopped working. a problem caused the program to stop working correctly"
    It is saying in am connected to my hub and have a strong signal.
    Can you help
    Thanks
    Steve

    Hello Steve
    Have you tried to use some other browser?
    Do you use Skype or some other messenger? Can any of them connect properly?
    I dont know what the real problem is. Non working Internet explorer or WLAN connection in general?

  • Im trying to download apps from itunes but it cannot push through. It happened after i update my software to ios 6. Can someone please help me resolve this in my ipad? Thanks!

    Hi im trying to download apps in my ipad but it cannot push through and remained waiting. This happened after i updated my software to ios 6. Can someone please help me?

    You may not get a response as you are shouting at everyone.
    All caps indicates shouting, is considered rude, and is difficult to read.
    Many will not read such posts.
    Try turning off you caps lock and asking again.

  • HT3310 I have an iphone 5. Speaker works but I cannot hear through the apple earbuds. Tried multiple earbuds and none work. But they work in other iphone 5.

    I have an iphone 5. Speaker works but I cannot hear through the apple earbuds. Tried multiple earbuds and none work. But they work in our other iphone 5.  Has anyone been able to resolve this without pursuing a replacement ?  If so what was the fix?

    You're not using a supported carrier. What did you think Apple was going to tell you?
    As fizzDripper suggests, contact the SIM card provider. How to make an unsupported SIM work on your phone is not Apple's problem.

  • Why won't Apple accept debit cards?  I ordered 2 new iPhones at ATT on Monday using my debit card.  I was just notified by ATT that Apple wont accept debit cards so my order cannot go through.  I don't use credit cards so I don't carry debt!

    Why won't Apple accept debit cards to buy an iPhone 5?  I ordered 2 new iPhones at ATT on Monday using my debit card.  I was just notified by ATT that Apple wont accept debit cards so my order cannot go through.  I don't use credit cards so I don't carry debt!  They (ATT) re-emphasized this is not their policy, but Apple's and that I would have the same problem if I went to Verizon.  Is this really the policy and if so why?  Apple has no problems accepting debit cards for my iTunes account?!

    I think this is an AT&T thing not an Apple policy, I had this battle with them before when the 4s came out.So this time I went directly to the Apple stor, I had no problem pre-ordering my Iphone5 on the 14th with my debit card, already shipped will be here the 21st. I'd go straight to the Apple store and purchase them there...

  • IPhone 4 cannot scroll through a certain spot on the screen

    This problem is intermittent, so I first assumed it was a software problem, but it has been restored both at home and at the Apple store with no success.
    About 50% of the time, I cannot scroll through the bottom 10% of the screen. For the most part it isn't a huge deal, but on apps like Words With Friends I cannot drag letters up from the bottom. On certain webpages with a "yes" or "no" option at the bottom, I cannot click either one. Sometimes I'm able to to switch to landscape mode and bypass the problem, but not on all apps. The keyboard also goes wacky periodically while sending text messages (as in some letters will not "click" at first, and sometimes each click produces 5 or 6 of the letter).
    Running 5.0.1 on an iPhone 4.
    Any suggestions?

    Hello again.
    I am quite new to the program myself but over the last few weeks editing one particular image I have found that this program will do practically anything I want.  I just persevere through each frustration and eventually figure it out.  I just wish it were easier to remember what I did to get the result...oh wait, there is a way for that too lol.
    I believe you will find it best to have your image on its own layer.
    As for the rulers,  check to see if it is turned on, I believe that choice would be under the tab at the top labeled VIEW?  Not in front of puter right now so not sure exactly.
    Also, you might want to check your settings for many of this type of feature in the PREFERENCES area.
    Please let us know your progress.  Good luck!
    Sent from my iPhone

  • HT1430 cannot hear through phone except with speaker on- how do I fix this?

    cannot hear through phone except with speaker on- how do I fix this?  I am handling all calls now through speaker

    Go to settings/general/ accessibility/incoming calls and make sure it is set to default

Maybe you are looking for

  • Few suggestion for WP8 - if at all given a thought

    I have recently upgraded form Nokia N8-00 to Nokia Lumia 925 and immediately noted few very important things missing. 1: I could transfer most of my data from N8-00 to Lumia 925 except calender entries and notes. For me all calender entries and noted

  • NW2004s preview install problem (dispatcher)

    Hi, I am trying to install the preview version of NW2004s workplace on my XP machine/2GB but   I don't maange  because the J2E engine doesn't start. The jcontrol process is started correctly, but the dispatcher one never manage to start... After 20 m

  • Single Sign-On in Oracle 8.0

    Hi, We have our own apllications and we dont want to display the logon screen when u launch the application, it should pick up the NT userid and authenticate it.We have Oracle 8.0 databse on Unix and Windows NT/2000 on client side. Any help would be

  • Problem with Manifest file

    Hi all, I have application which is running fine both from my netbeans ide and from command prompt, but when i run a jar file created either by netbeans or from command line using " jar cmf mainClass.txt Nyse_Proj.jar *.class" i get an error Could no

  • Flash Banner has two hyperlink, how do i make that work in iweb?

    I created an iframe for a banner. It works great. However, the flash banner has two different links depending as to when you click on it it can take you to one of two sites. When using iFrame, the new windows open within that frame. Is there a way to