I believe there is something wrong, or at least unpleasant in the Restlet
Engine (V1.1 RC2).

 

I am using the "language" as a form input.

 

I have a simple test case (below) which mimics the form input.

 

Input of this:

 

http://localhost:8080/test?lang=all
<http://localhost:8080/xbrlet/test/test?lang=all&language=all&xyz=all>
&language=all&xyz=all

 

Provides (expected):

 

Test Form Data:
        lang = all
        xyz = all
        language = all

 

But, input of this:

 

http://localhost:8080/test?lang=fr
<http://localhost:8080/test?lang=fr&language=fr&xyz=fr> &language=fr&xyz=fr

 

Provides (unexpected):

 

Test Form Data:
        lang = fr
        xyz = fr

 

(note missing "language = fr "text).

 

Random sampling:  It works for language="it", and "de", but not "en" or
"fr".

 

Is there something special about the language name?  I can of course use
some other name, but I spent hours tracing this down.  I have tried it in
Tomcat (my standard environment) and standalone.

 

Here's the quick test code, pasted basically into your HelloWorldResource
example:

 

    @Override

    public Representation represent(final Variant variant) {

 

        final Form form = getRequest().getResourceRef().getQueryAsForm();

        final StringBuffer formsb = new StringBuffer();

        if (form != null) {

            formsb.append("Form Data:\n");

            for (String name : form.getNames()) {

                final String value = form.getFirstValue(name);

                formsb.append("\t");

                formsb.append(name);

                formsb.append(" = ");

                formsb.append(value);

                formsb.append("\n");

            }

        }

 

        final Representation representation = new StringRepresentation("Test
" + formsb.toString(), MediaType.TEXT_PLAIN);

 

        final Response response = getResponse();

        response.setStatus(Status.SUCCESS_OK);

 

        return representation;

    }

 

 

Cliff Binstock

Coyote Reporting

Reply via email to