Einstein47
Programmer
I need to be able to pass the & character on the URL string. Is that possible?
My situation is rather complicated. I am maintaining a JSP/Servlet application that reads from the database and pulls various data elements for a specific record ID. The name is allowed to have special characters. The user selects the record id on a popup window which calls a servlet to get the info. It then takes the information and passes it to a special JSP page that parses the URL string for name/value pairs and does this:
in a loop for all the name/value pairs it finds.
The big problem happens when a value has an & character because it is parsed as a pair separator goofs up all the rest of the pairs.
Can I simply escape the ampersand with a back-slash to keep it from being taken as a separator? Or do I need to do something more complicated? (my mind has started coming up with possible work-arounds, and none of them are pretty)
Any takers? Einstein47
("Vision without action is a daydream - Action without vision is a nightmare. Japanese Proverb"
My situation is rather complicated. I am maintaining a JSP/Servlet application that reads from the database and pulls various data elements for a specific record ID. The name is allowed to have special characters. The user selects the record id on a popup window which calls a servlet to get the info. It then takes the information and passes it to a special JSP page that parses the URL string for name/value pairs and does this:
Code:
window.opener.document.getElementById("<%=name%>").value="<%=value%>";
The big problem happens when a value has an & character because it is parsed as a pair separator goofs up all the rest of the pairs.
Can I simply escape the ampersand with a back-slash to keep it from being taken as a separator? Or do I need to do something more complicated? (my mind has started coming up with possible work-arounds, and none of them are pretty)
Any takers? Einstein47
("Vision without action is a daydream - Action without vision is a nightmare. Japanese Proverb"