Results 1 to 2 of 2
  1. #1
    dhazwa is offline Member
    Join Date
    Jul 2011
    Rep Power

    Default UrlConnection question(s)


    I have two questions about urlconnection.

    First, when trying to connect to a site that also has a mobile version, the site keeps responding with the mobile version. How can I make it take me to the normal site? I asked this question before, and someone told me to try setting the user agent. I set the user agent and it did not make a difference.

    Second, when trying to connect to a page that runs javascript, it keeps redirecting me to the <noscript> version. Is there a way to enable the urlconnection to allow javascript/not block javascript?


  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    If you have to specifically define what the URL is, then how it pick the mobile version? Can you show me how did you open the connection.

    Regarding your second question, UrlConnection doesn't do anything with the scripts. Actually it can't. UrlConnection just gets the content and it doesn't try to parse it and do anything with JS/HTML/CSS and so on.

Similar Threads

  1. Lock between URLConnection and
    By mab in forum Networking
    Replies: 1
    Last Post: 02-24-2011, 12:21 PM
  2. URLConnection Efficiency
    By Lil_Aziz1 in forum New To Java
    Replies: 22
    Last Post: 08-19-2010, 06:27 PM
  3. URLConnection not timing out as expected
    By StephenS in forum Networking
    Replies: 2
    Last Post: 04-02-2010, 03:10 AM
  4. How to set request parameters to an URLConnection
    By somesh A in forum Networking
    Replies: 0
    Last Post: 04-10-2009, 08:08 AM
  5. Opening URLConnection
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-24-2007, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts