Two Laptop Bag
The moose likes Servlets and the fly likes How read the first URL which is there in the browser Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "How read the first URL which is there in the browser" Watch "How read the first URL which is there in the browser" New topic
Author

How read the first URL which is there in the browser

yashpal waghmare
Greenhorn

Joined: Sep 17, 2008
Posts: 22
I am trying to read the URL like for eg,

I have entered URL like www.google.com and i want to store this URL as a string and I want to use this url in another java class as string in method like response.sendRedirect("that string").

How do i can do?


Thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Rule one about Servlets: they only know about the data passed to them as part of a request. You can't read the current state of the browser from a servlet.

Assuming you are sending a request however. You can get a whole bunch of information about the request from the HttpRequest class. Have a read through the API.
[ December 23, 2008: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How read the first URL which is there in the browser
 
Similar Threads
opening default web browser in linux/unix/solaris/windows
Problem with response.sendRedirect
how to open url in same window
difference between openConnection() and connect() methods
go to a web url using java code