Use java.net.URL
to parse a url string:
URL url = new URL("http://test.com/testapp/test.do?test_id=1&test_name=SS");
System.out.println(url.getPath()+"?"+url.getQuery());
More Related Contents:
- Java URL encoding of query string parameters
- Simplest way to read JSON from a URL in Java
- How to use a servlet filter in Java to change an incoming servlet request url?
- How to construct a relative path in Java from two absolute paths (or URLs)?
- URLEncoder not able to translate space character
- Java – class.getResource returns null
- Read url to string in few lines of java code
- How to detect the presence of URL in a string
- How do I make an http request using cookies on Android?
- Getting URL parameter in java and extract a specific text from that URL
- Registering and using a custom java.net.URL protocol
- How to check if a URL exists or returns 404 with Java?
- How to check for a valid URL in Java?
- How to obtain the last path segment of a URI
- Check if file exists on remote server using its URL [duplicate]
- What’s the difference between a Resource, URI, URL, Path and File in Java?
- Java HttpServletRequest get URL in browsers URL bar
- Get file name from URL
- java.net.URL read stream to byte[]
- Safe use of HttpURLConnection
- InputStream from a URL
- How to get list of files/directories of an directory URL?
- How do I encode URI parameter values?
- What is the idiomatic way to compose a URL or URI in Java?
- java.net.URLEncoder.encode(String) is deprecated, what should I use instead?
- how to send an array in url request
- Checking if a URL exists or not
- Java: how to get a File from an escaped URL?
- Java: Get URI from FilePath
- How to load a folder from a .jar?