Hello,

Restlet is designed to follow the REST style of architecture. One base concept of REST is the component. A component is somewhere in the Internet and is able to communicate with other components via connectors, that is to say client and server connectors.
Transposed to the Restlet, you can find a Component class that holds a list of client connectors and server connectors. In addition, a Component is a "container" of Restlet instances (for example instances of the Application class).
A Component allows hosted Restlets to use client connectors, and is able to transmit to the hosted Restlet the requests that come from the server connectors. This allows to share these features between all hosted Restlets.

[Having said that, you can use server and client connectors in a standalone mode. The more common sample code is the following:
Client client = new Client(Protocol.HTTP);
Response response = client.get("www.example.com");]

A Restlet-based application can run in a standalone mode or inside a servlet container. Standalone means that you just rely on the JDK and a few jars. Just invoke from the command line your "main" method that creates and starts your Component, and your HTTP server is ready. All HTTP server connectors, except one, are compatible with this mode.
The exception is the "servlet" connector, that allows your Restlet-based application to run inside a servlet container.
The choice between the "standalone" and the "servlet" modes depends on your constraints or your taste.

 

Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


Hi,

        i am new to restlet, started exploring. i found we can access an
application mapped to ServerServlet in a web application, as well we can
create a application where we use restlet client to create a client and use
main to start application. 

in the first approach we are using the web server, where as the second
approach we use restlet webcontainer for our application launch.. am i
right?

if not clarify me, as tell me which way is suggested and best

Thanks in advance
  

Reply via email to