This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes how to restrict facebook related code when user access from china Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to restrict facebook related code when user access from china" Watch "how to restrict facebook related code when user access from china" New topic
Author

how to restrict facebook related code when user access from china

chaitanya pai
Greenhorn

Joined: Aug 24, 2011
Posts: 1
Hi all,

I have a page where facebook plugin need to be loaded and displayed. It is working fine. But if user try to access the same page from china, where facebook is blocked, page loading is taking too much time.
This is because my page is keep on trying to connect to facebook to download the page and connection timed exception is coming. Can any one of you help me resolving this problem.

I think the implementation can be some thing like, first check whether the user network allows facebook or not. If it allows then download the plugin otherwise dont download the plugin. But dont know how to achieve this.

Any suggestions would be of great help

Thanks in advance,

Chaitanya.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You can check the IP address of the request, and then use an API like Maxmind GeoIP to figure out the country from that - if it's China, serve appropriate content.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to restrict facebook related code when user access from china
 
Similar Threads
eclipse singleton plugin
How to link a social account in my application?
Spring Hibernate Plugin Needed...??
Disable "BACK" button..(urgent)
keep track of a field in database