What’s the best way to get the current URL in Spring MVC?

Well there are two methods to access this data easier, but the interface doesn’t offer the possibility to get the whole URL with one call. You have to build it manually: public static String makeUrl(HttpServletRequest request) { return request.getRequestURL().toString() + “?” + request.getQueryString(); } I don’t know about a way to do this with any … Read more

What is the etymology of ‘slug’ in a URL? [closed]

The term ‘slug’ comes from the world of newspaper production. It’s an informal name given to a story during the production process. As the story winds its path from the beat reporter (assuming these even exist any more?) through to editor through to the “printing presses”, this is the name it is referenced by, e.g., … Read more

What is the meaning of # in URL and how can I use that?

Originally it was used as an anchor to jump to an element with the same name/id. However, nowadays it’s usually used with AJAX-based pages since changing the hash can be detected using JavaScript and allows you to use the back/forward button without actually triggering a full page reload.

What is the difference between URL parameters and query strings?

The query component is indicated by the first ? in a URI. “Query string” might be a synonym (this term is not used in the URI standard). Some examples for HTTP URIs with query components: http://example.com/foo?bar http://example.com/foo/foo/foo?bar/bar/bar http://example.com/?bar http://example.com/?@bar._=???/1: http://example.com/?bar1=a&bar2=b (list of allowed characters in the query component) The “format” of the query component is … Read more

Access a URL and read Data with R

In the simplest case, just do X <- read.csv(url(“http://some.where.net/data/foo.csv”)) plus which ever options read.csv() may need. Edit in Sep 2020 or 9 years later: For a few years now R also supports directly passing the URL to read.csv: X <- read.csv(“http://some.where.net/data/foo.csv”) End of 2020 edit. Original post continutes. Long answer: Yes this can be done … Read more