Skip to content

getHelpedParameters empty ifndef gwt #606

Closed

Description

@alepac

If using a different platform then gwt (e.g. jse) getHelpedParameters() returns an empty Series.

This is because there is an empty Context in the TemplateDispatcher.

A working patch is to set the ClientResource Context on the Creation of the TemplateDispatcher so add dispatcher.setContext(getContext()); just after the dispatcher instantiation in the org.restlet.resource.ClientResource.createNext() method.

Activity

  1. added a commit that references this issue on Jun 13, 2012
  2. thboileau commented on Jun 13, 2012

    @thboileau
    Contributor

    Hello,
    thanks a lot for the patch which has been applied to the master and 2.1 branch.
    However, we should add a little bit more details here.
    When defining a server side application, we usually create an instance of Component.
    The Component defines a set of server connectors (usually http, https), and client connectors (http, file, clap, etc).
    A Component shares a single instance of all these connectors and allow all client calls issued from the application and theirs resources to be handled by these few connectors.
    When instantiating ClientResource outside a Component, each new instance of ClientResource embeds its own client connector, which, in case, of the internal connector leads to create several pools of threads, etc. This is not optimized.
    It's better to instantiate the client connector once and call ClientResource#setNext for each new instance of ClientResource.

    By doing so, you can set up the client connector context and parameters, instead of setting up the clientresource context and shares this with the client connector.

    However, we recognize this is quite unusual, and not very well documented...

    I've entered an issue (#608) in order to magically create this underlying Component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions