By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,821 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

httpservletrequest parameters in netscape

P: n/a
Hi,

I have a jsp with some list box. And when user selects an option in
the list box, I would then generate a url to direct the user to the
correct page. The url is of the form:
<hostname>/context/root?page=mypage&value=myvalue
Now, my application needs to be XHTML compliant, so I can't use the
'&' directly. Instead, I'll have to replace it with &amp; So my url
becomes
<hostname>/context/root?page=mypage&amp;value=myvalue
On IE, it is working great. My servlet would process as per norm and
it is able to get the page,mypage and value,myvalue parameter-value
pairs.
However, I have some problems on Netscape. The parameter-value pairs
I got were page,mypage (which is correct) and amp;value,myvalue (which
is not correct). The second pair has the additional "amp;"
Any one has any idea on fixing this? Remember, I am not allowed to
use simply the ampersand symbol.

Many thanks,
Soo Kean
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Some more info...

Here's some snippet for the list box:
<select name="mylistbox" id="select2" onchange="setLang()">

And here's a simplified version of my setLang()
function setLang()
{
document.location.href="www.myserver.com?page=mypa ge&amp;page2="+document.listbox[listbox.selectedIndex].value;
}
Jul 17 '05 #2

P: n/a
"sookean" <so********@yahoo.com> wrote in message
news:f6**************************@posting.google.c om...
Some more info...

Here's some snippet for the list box:
<select name="mylistbox" id="select2" onchange="setLang()">

And here's a simplified version of my setLang()
function setLang()
{
document.location.href="www.myserver.com?page=mypa ge&amp;page2="+document.li
stbox[listbox.selectedIndex].value; }


This is not a Java problem, it's an HTML one. And why wouldn't you use the
ampersand for its intended purpose?
Jul 17 '05 #3

P: n/a
so********@yahoo.com (sookean) wrote in message news:<f6*************************@posting.google.c om>...
Hi,

I have a jsp with some list box. And when user selects an option in
the list box, I would then generate a url to direct the user to the
correct page. The url is of the form:
<hostname>/context/root?page=mypage&value=myvalue
Now, my application needs to be XHTML compliant, so I can't use the
'&' directly. Instead, I'll have to replace it with &amp; So my url
becomes
<hostname>/context/root?page=mypage&amp;value=myvalue
On IE, it is working great. My servlet would process as per norm and
it is able to get the page,mypage and value,myvalue parameter-value
pairs.
However, I have some problems on Netscape. The parameter-value pairs
I got were page,mypage (which is correct) and amp;value,myvalue (which
is not correct). The second pair has the additional "amp;"
Any one has any idea on fixing this? Remember, I am not allowed to
use simply the ampersand symbol.

Many thanks,
Soo Kean <hostname>/context/root?page=mypage&amp;value=myvalue

Where is it written? 'D like to see the actual code.
Jul 17 '05 #4

P: n/a
sookean wrote:
Some more info...

Here's some snippet for the list box:
<select name="mylistbox" id="select2" onchange="setLang()">

And here's a simplified version of my setLang()
function setLang()
{
document.location.href="www.myserver.com?page=mypa ge&amp;page2="+document.listbox[listbox.selectedIndex].value;
}


Two points:

1) This question is off-topic for this (non-existent) group.
2) Does the version of Netscape you are using claim to be XHTML
compliant? Are you identifying your document as as XHTML document and
not simply an HTML document?

Ray
Jul 17 '05 #5

P: n/a
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<It********************@texas.net>...

This is not a Java problem, it's an HTML one. And why wouldn't you use the
ampersand for its intended purpose?


Yeah... I wasn't sure where to post this. Cause it is in some sense
Java because in my servlet code, written in Java, it uses the
HTTPServletRequest to get parameters. Things works on IE when I used
&amp;, but it does not work well in Netscape. Maybe I should post
this to a group called Netscape?

I am not really "allowed" to simply use the ampersand symbol because
my application needs to be XHTML compliant. And XHTML compliance does
not allow a single ampersand symbol. Tools like WebKing will
highlight that it is not compliant.

Thanks
Jul 17 '05 #6

P: n/a
"sookean" <so********@yahoo.com> wrote in message
news:f6**************************@posting.google.c om...
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message

news:<It********************@texas.net>...

This is not a Java problem, it's an HTML one. And why wouldn't you use the ampersand for its intended purpose?


Yeah... I wasn't sure where to post this. Cause it is in some sense
Java because in my servlet code, written in Java, it uses the
HTTPServletRequest to get parameters. Things works on IE when I used
&amp;, but it does not work well in Netscape. Maybe I should post
this to a group called Netscape?

I am not really "allowed" to simply use the ampersand symbol because
my application needs to be XHTML compliant. And XHTML compliance does
not allow a single ampersand symbol. Tools like WebKing will
highlight that it is not compliant.

Thanks


I'd go with alt.html or something like it. However, the answer you're likely
to get there is that you shouldn't use JavaScript the way you're using it
and that the URL you're creating indicates a questionable design. Actually,
I believe there's a way to select a different character besides the
ampersand to use for query strings.
Jul 17 '05 #7

P: n/a

"sookean" <so********@yahoo.com> wrote in message
news:f6*************************@posting.google.co m...
| Hi,
|
| I have a jsp with some list box. And when user selects an option in
| the list box, I would then generate a url to direct the user to the
| correct page. The url is of the form:
| <hostname>/context/root?page=mypage&value=myvalue
| Now, my application needs to be XHTML compliant, so I can't use the
| '&' directly. Instead, I'll have to replace it with &amp; So my url
| becomes
| <hostname>/context/root?page=mypage&amp;value=myvalue
| On IE, it is working great. My servlet would process as per norm and
| it is able to get the page,mypage and value,myvalue parameter-value
| pairs.
| However, I have some problems on Netscape. The parameter-value pairs
| I got were page,mypage (which is correct) and amp;value,myvalue (which
| is not correct). The second pair has the additional "amp;"
| Any one has any idea on fixing this? Remember, I am not allowed to
| use simply the ampersand symbol.
|
| Many thanks,
| Soo Kean

Have you tried using #38 instead? or URLEncoding it & decoding it in your
Servlet?
--
-P
"Much as some folks hate to lose their way, me, I pray to God that I will."
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.