Hi Jérôme & co.,

For one project I am using my own class that parses the parameters for
me. It shares some similarities with the Form class. While working
with my class I had the idea that the Form class should have another
constructor that takes a Call as argument.

I.e.:
     public Form(Call call) {
            if (call.getMethod().equals(Methods.POST)) {
               Factory.getInstance().parsePost(this, call.getInput());
            }
            else if (call.getMethod().equals(Methods.GET) {
                 Factory.getInstance().parseQuery(this,
                                                  call.getQuery());
            }
            else {
                 throw new UnsupportedOperationException("...");
            }
     }

In the restlet instances the user can always call

   Form form = new Form(call);

regardless of the concrete HTTP method.

Best regards,
Lars
-- 
http://semagia.com

Reply via email to