Getting the URL from the browser


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Getting the URL from the browser

  1. #1
    Join Date
    Jul 2005
    Posts
    54

    Getting the URL from the browser

    HI,
    I want to get the url typed in the browser by the user using Java Program.
    and want to send that code to a server(my server program)running continuously.
    Can anyone tell me how to get the url typed in the browser?

    Thanks a lot

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    You can use javascript to access an applet via its tag name. If the applet has a public method called, say,
    Code:
    public void setUserURL(String urlStr) {
      .
      .
    }
    and the applet name is urlApplet (not the class name, but the name in the applet tag),
    then you can access the applet from javascript like:
    Code:
    urlApplet.setUserURL(history.current());
    You then include this applet's tag in all the pages and have the javascript onLoad handler execute the applet method. The applet (just a blank, borderless label of a few pixels with the background color) can be tucked away in a corner of the webpage.

    The applet can communicate with the server via an HttpURLConnection.

    The only problem is that when the client enters the url of another site then your server, your server will not be notified.

    PS:
    I have failed to find eventhandlers or other functions in javascript that triggers on the entered url in the browsers url-field before the client has hit ENTER. And java certainly has none (sandbox).
    eschew obfuscation

Similar Threads

  1. display the current active URL on browser IE
    By Max bayne in forum VB Classic
    Replies: 0
    Last Post: 07-20-2006, 02:28 PM
  2. New Target Window for links Re: Help- URL HELP-
    By Rachel Ernst in forum Architecture and Design
    Replies: 1
    Last Post: 02-13-2001, 02:15 PM
  3. Caching the URL
    By gvt in forum VB Classic
    Replies: 0
    Last Post: 02-07-2001, 09:47 AM
  4. Caching the URL
    By gvt in forum VB Classic
    Replies: 0
    Last Post: 02-07-2001, 09:47 AM
  5. Replies: 0
    Last Post: 04-06-2000, 11:22 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center