File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63866

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

[Asking smart questions] [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:
subject: getting parameters from the URL
It's not a secret anymore!