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. :-(
Sorry, I'm new to Hunchentoot. Please bear with me. Thanks. :-)
"Rommel Martinez" ebzzry@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.
On Feb 12, 2008 2:37 PM, Victor Kryukov victor.kryukov@gmail.com wrote:
"Rommel Martinez" ebzzry@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
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
Sweet! Thanks! :-)