๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.language
2 messages
2 total messages Started by R Sun, 24 Sep 2006 10:16
Problem with querystring special characters
#260
Author: R
Date: Sun, 24 Sep 2006 10:16
27 lines
1880 bytes
Hi,
I've a problem with querystring parameters, using URLEncoder.encode(), with 
java 1.3, so method encode(String), with only a String parameter.

The first problem is about the character "&". For ex:
http://webapp/web.jsp?p1=stringa1&p2=stringa2&p3=me&you

The p3 parameter, "me&you", is retrieved by the destination jsp only as 
"me", also if I've used the method encode(). The encode parameter appaers 
like "me%**you" (where ** are characters), but in the destination page 
request.getParameter("p3") is always "me".

How I have to do to get correctly "me&you"?

Same problem with URLEncoder.encode("Novit๏ฟฝ"). The "๏ฟฝ" character is encoded 
like "%**", but the request.getParameter("__") retrieves "Novit?".

How I can do?

Thank you!


-- 
E' un mondo difficile

Rivist@ random generator:
http://www.rivistaonline.com/Rivista/ArticoliPrimoPiano.aspx?id=2720
Re: Problem with querystring special characters
#262
Author: Shankar Unni
Date: Mon, 25 Sep 2006 18:46
11 lines
1451 bytes
R@ wrote:

> http://webapp/web.jsp?p1=stringa1&p2=stringa2&p3=me&you

This is hardly a Borland-specific question: you can obviously see that 
you need to encode the "&" above, otherwise how is your webserver going 
to distinguish that one from the others?

Hint: use the hex code for '&': as in %26:

http://webapp/web.jsp?p1=stringa1&p2=stringa2&p3=me%26you
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads