On 24.04.2013 15:10, Rahkonen Jukka wrote: >> In OrbisGIS, it's up to the user to give the URL. As we're not speaking about >> > people that know HTTP well, most of them will forget the ending ? >> > or &. This URL is given directly to the client, and if the ? or & is >> > missing at the >> > end, requests will fail. But as said, I can change things in OrbisGIS, >> > just before >> > making calls to the WMS client. > Hi, > > OpenJUMP takes WMS urls with or withour ending "?" or ending "&" without > troubles so there must be code for handling these cases.
ok, i see what you are trying to achieve. the correct way to handle query strings (which is what url parameters after the "?" are called) is to check if there exists one already and then either using "?" to attach or "&" to concatenate. you can easily check if there is a query string already via new URL("http://host/path?foo=bar").getQuery() a simple match for "?" should do as well, as the spec for URLs only allows "?" to be there one time to separate the query string from the rest of the URL. other question marks if desired have to be url encoded. generally later parameters with the same key overwrite earlier definitions eg. ?foo=bar&foo=karl will often end up with the server using "foo=karl". but actually this must be defined in the standard and varies between web applications. btw. URLs are totally valid with a trailing "?". it simply means they have no query string... ..ede ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel