I have a Test Client which makes Restlet Request as below : 

public class TestRestlet {
public static void main(String[] args) throws IOException {
    CookieHandler.setDefault(new CookieManager( null, CookiePolicy.ACCEPT_ALL 
    ClientResource resource = getClientResource();
    Representation rep = resource.get();


private static ClientResource getClientResource() {
    String resouceURL = 
    CookieSetting cookie1 = new CookieSetting("USER", 
    ClientResource resource = new ClientResource(resouceURL);
    return resource;

At Restlet Servlet I want to read these cookies from request and send them back 
to calling client to fetch some information based on the cookie.

But I am unable to retrieve the cookies : I have set my debugger at service 
method of org.restlet.ext.servlet.ServerServlet and the request has no cookies.

public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
Is this the correct way to set cookies in request what am i doing wrong.?


Reply via email to