How to use webview on localhost

I have installed openHab on Raspberry Pi 2 and on the same Raspberry I have installed my energy meeter (http://www.serielsrl.it/progetti/pic-berry). This system can log the PV and the energy consumption and can switch on and off some devices via radio 433 Khz.
This system use apache and the PORT is 2001
To switch on/off the devices I use this in items:
Switch Light_GF_PresaTV “TV” (GF_Living, Lights) { http=">[ON:POST:http://localhost:2001/xxx.php?cmd=on&device=TV] >[OFF:POST:http://localhost:2001/xxx.php?cmd=off&device=TV]"}
And it work fine.
To view the barchart I use this in sitemaps:
Webview url=“http://localhost:2001” height=25
but not work. Instead using:
Webview url=“http://192.168.1.5:2001” height=25 (the ip of raspberry) it work fine.
How can I solve this ?
Thanks.

Remember that when you provide the URL for the Webview, it is the client that needs to get to that address, not the server. So, for example, if you are on mycomputer1 and OH is on ohserver when the web browser tries to load that webview it will be using localhost for mycomputer1, not ohserver. So you must use the IP address or if DNS/hosts/etc is configured.

So if you use localhost in the URL the ONLY place it will work is on the same machine as your apache port 2001 server is running on.

Thank you for very clear explanation.
Then: http binding work server side and webview work client side.