Thanks for the answer and comments embedded below
> I would use the URLEncoder class. Just remember not to encode the
> getMethod()'s
> delimiters, i.e., ? and =.
Well we did use it. But there is a problem. We are using the parameter
where in two different ways
1) as part of form submission through
<input name="where" value="cust_id like '%901%'" type=hidden> then
the
The browser encodes the %901% as %25901%25 and sends it to the
server. The HttpUtils.parseQueryString works ok. However if
encode '%901%' then the whole things go haywire. Because browser encodes
the encoded
string again.
2) a url link
<a href="........&where="cust_id+like+'%901%'......>link<a/>
Here the browser is not encoding the '%901%' and sends the '%901%'
as it is. Here it works OK if I encode.
So my problem is that I need to encode for case 1. and I should not
encode for case 2. I wanted to know if someone what are the conditions
under which the browser encodes. I am using Netscape 4.05.
> But better than that, why are you sending SQL string? Re-look at your design.
> Why can't you just send bookhouse and 901?
Well that will be difficult because these screens are generated by
XML+XSL combination. They are generic and the same servlet and
associated classes handle without knowing the name of the class. By the
way, bookhouse is the database name and acmaster is the tablename. We
have XML definitions stored as
<dbname><tablename>....</tablename></dbname>. Hence the /. By the way is
/ causing the problem
> Sans adieu,
> Danny Rubis
>
> "S.Ramaswamy" wrote:
>
> > We have been having this problem which has been making 1999 end
> > misearable. I appreciate if someone can help out on this one.
> >
> > We have URL link in our HTML page generated by our servlets that looks
> > somewhat like this
> >
> > servlet/server?table=bookhouse/customer&where=+cust_id+like+'%901%'
> >
> > servlet/server == the servlet named server
> > table parameter 1 name of the database/table
> > where where condition that says cust_id like '%901%'
> > to be used by the SQL
> >
> > a) we have replaced all spaces with '+' as required
> > b) we have left '%901%' hoping that this will be converted as
> > %27%25901%25%27 by the browser. But unfortunately the
> > browser is not doing and it sends it as
> > %901% only. However the servlet container thinks that it is encoded and
> > converts '%901%' to '1%', i.e %90 is unencoded by
> > HttpUtils.parseQueryString(). Now if I remember correctly, this used to
> > happen earlier. This has
> > recently started. My question is does the servlet/web server send
> > something to the browser to say that it must encode url
> >
> > Grateful for any help :-)
> >
> > ==--==--==--==--==--==--==--==--==--==--==--==--==--==
> > S.Ramaswamy
> > Matrix Infotech Syndicate
> > D-7, Poorti, Vikaspuri, New Delhi, 110018, India
> > PHONE: +91-11-5610050, FAX: +91-11-5535103
> > WEB http://MatrixInfotech.HyperMart.Net
> > ==--==--==--==--==--==--==--==--==--==--==--==--==--==
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
==--==--==--==--==--==--==--==--==--==--==--==--==--==
S.Ramaswamy
Matrix Infotech Syndicate
D-7, Poorti, Vikaspuri, New Delhi, 110018, India
PHONE: +91-11-5610050, FAX: +91-11-5535103
WEB http://MatrixInfotech.HyperMart.Net
==--==--==--==--==--==--==--==--==--==--==--==--==--==
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html