This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It would help to know where the code is that you want to use to read a URL. Is it in a JSP file? in a servlet? When you say "read a URL", do you mean get the URL that was sent by a browser to your servlet? Or do you want to forward to another URL?
If the code you are writing is in a servlet or JSP, you can get it with a combination of request.getServerName(), request.getServletPath() and request.getQueryString() where request is a variable pointing to the HTTPServletRequest that was passed to you by the web container. getServerName gives you the first part of the url (myserver.com) and getServletPath() give you the second part (/myApplication/myServlet) and getQueryString() gives you the parameters passed (?parm1=abc&parm2=def)
If you simply wish to look at a parameter passed to you, the best way is to use request.getParamter("parm1") or request.getParameters("parm1") if you expect more than one value in "parm1". The first returns a String, and the second returns a String array.