473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

httpservletrequest parameters in netscape

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
7 4101
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
"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
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
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
"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
"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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Desmond Rivet | last post by:
Hi all, I will do an experiment on this soon, but if anyone knows off the top of their head... Let's say you have a servlet that processes a POST request. A HTTP client sends a POST request...
0
by: Christine Zhou | last post by:
Hi, We have a customized HttpServletRequest object, when we run the application on webshpere 4.0.7,got a ClassCastException on this object, but was Ok on WAS4.0.1, Anyone know why, is this...
7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
13
by: Hiroshi Ochi | last post by:
Hello, Is it possible to initialize javascript function parameters (using MSIE 6.0 and above)? According to the link below, it seems possible to do this. ...
3
by: DCB | last post by:
Hello. I have an easy question, likely, that has me in a headspin. I have an include file to a frames based site that basically forces frames on the end user if they visit the site and hit a...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
4
by: Dan Krantz | last post by:
I have the following template to ensure that a given number (val) falls into a range (between vmin & vmax): template<typename T> T ForceNumericRange( const T& val, const T& vmin, const T& vmax)...
2
by: mfsiddiq | last post by:
Hi Everyone I need help regarding how to get the handle for httpServlet while using webService.Since we are using webservice,i am not able to get handle of httpServletRequest and...
13
by: Jeff | last post by:
We have an intranet website that currently uses ActiveX but we need to make it cross-browser compatible and also get around the problems we've been having with making it work with IE7 and Vista. We...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.