Hi, Ronald and Witold.

You're right, URLEncoder\URLDecoder from java.net package are very usefull in
the case when you need to proceed through URI some special characters. But...
How can Witold use this functionality when he is submitting form with method
_get_? If Witold can use javascript, Isuppose to write such function:

<script>

function encodeChars(formObj)

{

formObj.elemnts['elementName1'].value =
escape(formObj.elemnts['elementName1'].value);

...

formObj.elemnts['elementNameN'].value =
escape(formObj.elemnts['elementNameN'].value);


}

</script>

, and in form tag write onSubmit="encodeChars(this)"

You wrote Wednesday, May 29, 2002, 15:51:10:


RJR> If you use "method=post" I don't think you'll have a problem.  If you need
RJR> to pass the "%" in the URL, i.e. "method=get" then perhaps
RJR> URLEncoder.encode() and URLDecoder.decode() will do what you need.

RJR> Hi all

RJR> In my servlet application I need to allow users to use wildcards in
RJR> queries. The Oracle wildcard character is the "%" so e.g. in the user
RJR> could type street name as: "Uni%" instead of "University"
RJR> But if I use the "%", the URL parameters get messed up. For example
RJR> if I have on my page textboxes STREET_NO and STREET_NAME and
RJR> fill:
RJR> STREET_NO: 2%
RJR> STREET_NAME: UNI%

RJR> in the request URL I don't see STRETE_NO and STREET_NAME
RJR> appears as: 2 TREET_NAME with unprintable character.
RJR> Sometimes the value is changed.

RJR> I believe the "%" has special use in servlet request/response. I guess I
RJR> could change the wildcard to a "*" or something else. But wonder if
RJR> there is a way to handle the % properly

RJR> Thanks

RJR> Witold




-- 
Regards,
 Mike                          mailto:[EMAIL PROTECTED]


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to