[hunchentoot-devel] parameters
Victor Kryukov
victor.kryukov at gmail.com
Tue Feb 12 06:37:57 UTC 2008
"Rommel Martinez" <ebzzry at gmail.com> writes:
> Hi! How do I make an HREF link "call" a dispatch function (and "pass"
> parameters without having to write long strings like this:
>
> "/?foo=1&bar=2&baz=3"
>
> I am able to do it with forms, using POST, but not with HREFs. :-(
Hey Rommel,
one way to do that is to check Dr. Weitz's very own url-rewrite[1], a
Hunchentoot dependency, in particular ADD-GET-PARAM-TO-URL:
* (add-get-param-to-url "http://common-lisp.net/" "foo" "bar")
"http://common-lisp.net/?foo=bar"
* (add-get-param-to-url "http://common-lisp.net/index.html?frob=42" "foo" "bar")
"http://common-lisp.net/index.html?frob=42&foo=bar"
* (add-get-param-to-url "http://common-lisp.net/" "foo" "+")
"http://common-lisp.net/?foo=%2B"
Regards,
Victor.
[1] http://www.weitz.de/url-rewrite/#add-get-param-to-url
More information about the Tbnl-devel
mailing list