About 29,700,000 results
Open links in new tab
  1. java - How to get the path of a URL? - Stack Overflow

    Apr 6, 2011 · 1st method uses the URL.getPath method from the Java URL class. 2nd method uses a regex I found in SO (I lost the source link, otherwise I'd give credits to the author right …

    Missing:

    • Position

    Must include:

  2. java - Detect and extract url from a string? - Stack Overflow

    This little code snippet / function will effectively extract URL strings from a string in Java. I found the basic regex for doing it here, and used it in a java function. I expanded on the basic regex …

    Missing:

    • Position

    Must include:

  3. java - get current url of context - Stack Overflow

    Mar 18, 2014 · So, you want the base URL? You can get it in a servlet as follows: String url = request.getRequestURL().toString(); String baseURL = url.substring(0, url.length() - …

  4. Java URL Class - GeeksforGeeks

    Jan 11, 2025 · URL class in Java is a part of java.net package that makes it easy to work with Uniform Resource Locators (URLs). URL is simply a string of text that identifies all the …

    Missing:

    • Position

    Must include:

  5. Java Program to Get Components of a URL - GeeksforGeeks

    Apr 3, 2023 · The java.net.URL class represents a URL. There are constructors to make new URLs and methods to parse the various parts of a URL. However, the guts of the category are …

  6. A Simple Guide to the Java URL - Baeldung

    May 11, 2024 · A URL is a reference or an address to a resource on the network. And simply put, Java code communicating over the network can use the java.net.URL class to represent the …

  7. Checking if a URL Exists in Java - Baeldung

    Jan 16, 2024 · In this article, we looked at checking the response code to find the availability of a URL. Also, we looked at how it might be a good idea to use the HEAD method to save …

  8. Finding the Redirected URL of a URL in Java | Baeldung

    Apr 16, 2024 · Java provides the HttpURLConnection class, which allows us to make HTTP requests and handle responses. Also, we can make use of the HttpURLConnection to find the …

  9. How to identify the URL of an Java web application from within?

    Jul 2, 2010 · What you CAN do, is to inspect the servlet context when you receive an actual request and see what URL was used. Here is how it works for me and probably for most …

  10. How to Find the Real URL Behind a Redirect in Java

    How do you find the real URL behind the redirect? You can do this in Java using the HttpURLConnection class. Like this: String url = "http://bit.ly/23414"; HttpURLConnection con …

  11. Some results have been removed