How do I process GET query string URL parameters in backing bean on page load?

Yes, you can use the <f:viewParam> to set a request parameter as a managed bean property. <f:metadata> <f:viewParam name=”companyId” value=”#{bean.companyId}” /> </f:metadata> You can if necessary invoke a bean action using <f:viewAction> (JSF 2.2+ only) or <f:event type=”preRenderView”>. <f:metadata> <f:viewParam name=”companyId” value=”#{bean.companyId}” /> <f:viewAction action=”#{bean.onload}” /> </f:metadata> When using <f:viewAction> you can even return a … Read more

Why is the comma URL encoded?

The URI spec, RFC 3986, specifies that URI path components not contain unencoded reserved characters and comma is one of the reserved characters. For sub-delims such as the comma, leaving it unencoded risks the character being treated as separator syntax in the URI scheme. Percent-encoding it guarantees the character will be passed through as data.

Is array syntax using square brackets in URL query strings valid?

The answer is not simple. The following is extracted from section 3.2.2 of RFC 3986 : A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets (“[” and “]”). This is the only place where square bracket characters are allowed in … Read more

How can I remove the query string from the url after the page loads?

As others have said, you can do this using the History API in modern browsers (IE10+, FF4+, Chrome5+). There was no full example in the answers, so figured I’d share my solution, as I just had a requirement to do the same thing: history.pushState(null, “”, location.href.split(“?”)[0]); If you are using Modernizr, you can also check … Read more

How do I access query string parameters in asp.net mvc?

so far the best way I figured out is to create a copy of ViewContext.RouteData.Values and inject QueryString values into it. and then modify it before every ActionLink usage. still trying to figure out how to use .Union() instead of modifying a dictionary all the time. <% RouteValueDictionary tRVD = new RouteValueDictionary(ViewContext.RouteData.Values); %> <% foreach … Read more

Google sheet embed URL documentation

Here are some of the parameters I found for Google Docs (thanks goes to Joel http://obstruction.tumblr.com/post/60784440737/google-docs-url-parameters-rm-minimal-rm-full): Google Docs URL parameters: rm=minimal rm=full rm=embedded rm=demo rm=(render mode) ui=2 (select the interface version) chrome=false (full screen mode) frameborder=(size of border) q=(Whatever) Search Query gid=24 (Which sheet you want to display) widget=false single=true range=A2:AA26 Output=html format=(export spreadsheet) format=xlsx … Read more

What happens if the action field in a has parameters?

If the method attribute is set to GET, the browser drops the querystring parameters from the action attribute before constructing the form argument values. So in your example, the request to the server on submit will look like: /somePage.html?param2=value&param3=value So no, when the method is “GET”, as in your example, there’s no reason to do … Read more

How do I construct a Django reverse/url using query args?

Building an url with query string by string concatenation as suggested by some answers is as bad idea as building SQL queries by string concatenation. It is complicated, unelegant and especially dangerous with a user provided (untrusted) input. Unfortunately Django does not offer an easy possibility to pass query parameters to the reverse function. Python … Read more