Hallo Thierry,

can you put this in the wiki or on www.restle.org? I think it is useful if code fragments are available there.

Stephan

Thierry Boileau schrieb:
Hello all,

just a few words to complete the answer. The mechanism transfers data
from the query (method "extractQuery"), the entity (method
"extractEntity") or the Cookies (method "extractCookies") to the
request's list of parameters.

For example, your web form contains a select input field (called
"selectField") and a text field ( called "textField").
If you want to transfer them respectively to attributes named
"selectAttribute" and "textAttribute", just proceed as follow.
            @Override
            public Restlet createRoot() {
                Router router = new Router(getContext());
                Route route = router.attachDefault(MyResource.class);
                route.extractEntity("selectAttribute", "selectField", true);
                route.extractEntity("textAttribute", "textField", false);
                return router;
            }

You will get a String value in the "selectAttribute" (the selected
option), and a Form object which is a collection of key/value pairs
(key="textField" in this case) with the "textAttribute" attribute.

best regards,
Thierry Boileau

On Wed, Mar 12, 2008 at 9:09 AM, Stephan Koops <[EMAIL PROTECTED]> wrote:
Hello Thierry

actually there is a mechanism (applied when using the Router) which
 > extract parameters from query, cookies and entity into the request's
 > list of attributes.
 >
 Ok, this was new for me.

 Thanks for info!
  Stephan

Reply via email to