permaculture playing cards
The moose likes HTML, CSS and JavaScript and the fly likes '%' Character on the URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark " Watch " New topic

'%' Character on the URL

Mohammad Jaber
Ranch Hand

Joined: Apr 10, 2006
Posts: 46
hi ,
how can i send a parameter equals to '%' through the URL , '%' considered as a white space on the browser , is there a way to escape it or to change the browsers behavior .. thanks in advance

OCP , SCJP 5.0
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
use %25 inplace of just %

Mohammad Jaber
Ranch Hand

Joined: Apr 10, 2006
Posts: 46
Thanks it works fine ...
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

This may be out of subject considering we're in a Javascript forum, but you can encode the url's parameters using JSTL's <c aram> tag. This will ensure that all special characters will be encoded properly.

[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Use the Javascript encodeURI() method to easily encode a URL.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: '%' Character on the URL
It's not a secret anymore!