[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

WEBrock question

George Moschovitis

10/5/2004 9:45:00 AM

Hello everyone, here is a small webrick question:

when passing the following url to a webrick-servlet:

http://www.mysite.com/index.html?param=1;param...

i get:

request.query["param"] => 1

and not
[1, 2, 3]

like in cgi.rb

any workarounds?

George Moschovitis

4 Answers

Thomas Counsell

10/5/2004 10:53:00 AM

0

Off the top of my head I think the method you need is

request.query['param'].list

(request.query returns a FormData object which acts like a string but
has other stuff).

Tom

On 5 Oct 2004, at 10:49, George Moschovitis wrote:

> Hello everyone, here is a small webrick question:
>
> when passing the following url to a webrick-servlet:
>
> http://www.mysite.com/index.html?param=1;param...
>
> i get:
>
> request.query["param"] => 1
>
> and not
> [1, 2, 3]
>
> like in cgi.rb
>
> any workarounds?
>
> George Moschovitis
>
>



Robert Klemme

10/5/2004 10:56:00 AM

0


"George Moschovitis" <george.moschovitis@gmail.com> schrieb im Newsbeitrag
news:1096969518.285852.87620@h37g2000oda.googlegroups.com...
> Hello everyone, here is a small webrick question:
>
> when passing the following url to a webrick-servlet:
>
> http://www.mysite.com/index.html?param=1;param...
>
> i get:
>
> request.query["param"] => 1
>
> and not
> [1, 2, 3]
>
> like in cgi.rb
>
> any workarounds?

You probably wanted

http://www.mysite.com/index.html?param=1&param=2&a...

Note: "&" is the separator and not ";".

Kind regards

robert


PS: Was it a typo or on purpose?

George Moschovitis

10/5/2004 12:13:00 PM

0


> http://www.mysite.com/index.html?param=1&param=2&a...
> Note: "&" is the separator and not ";".

No ';' is the xhtml compatible separator, this is no typo.
'&' does not work like in cgi.rb either

-g.

--
www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437

Navel does not accept liability for any errors, viruses or omissions in
the contents of this message. The full corporate policy is available on
our site.

have fun: www.joy.gr

George Moschovitis

10/5/2004 12:16:00 PM

0

> request.query['param'].list

Thank you very much, this is it :)

George Moschovitis

--
www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437

Navel does not accept liability for any errors, viruses or omissions in
the contents of this message. The full corporate policy is available on
our site.

have fun: www.joy.gr