java - Show encoded url on web browser address bar -


i want show encoded url on web browser address bar when corresponding url going. aleady url , encoded using given code.

       string geturl=request.getrequesturl().tostring();        out.println(geturl);        string output = urlencoder.encode(geturl);        out.println(output); 

you have encode individual query string parameter name and/or value.

string url = "http://mysite.com/query?q=" + urlencoder.encode("bla bla", "iso-8859-1"); // or "utf-8". 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -