jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes getting parameters from the URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "getting parameters from the URL" Watch "getting parameters from the URL" New topic

getting parameters from the URL

Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 141

I found the code below using google which works fine but i don't understand it. now unfortunately i've hit a problem; one of my parameters has an & in it. this has been escaped to & but the code below just picks out the & and my program breaks down.

Could someone explain the code please.


[ March 24, 2005: Message edited by: Eric Pascarello ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
How is the code being escaped?

The & should be escape to %27 and it would make your life easier.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63349

Eric ic correct. There is a big difference between URL encoding and HTML encoding.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 141
I'm not entirely sure how the & is being escaped. I use cocoon and it's serverpages technology. I query a database table and put the returned results into a list box. Viewing the source of this page I can see that any record containing an & has this escaped to &

I agree. Here's the link: http://aspose.com/file-tools
subject: getting parameters from the URL
It's not a secret anymore!