Hi,

At the moment i would like to use restlet without the transport 'attached'. I think I'm not using the correct terminology. An example follows which maybe makes it clearer ...

So, actually, everything works fine, and it can do what I want it to do on the basis of this simple test.

My question is, am I missing something in the framework here ... ?

regards,

Roger



public class XXX2
{

 public static void main(String[] args) throws Exception
 {
   Router router = new Router();
   router.attach("/xxx/{x}", XXX4.class);

   Request req = new Request(Method.GET, "/xxx/fv");
   Response res = router.handle(req);

   System.out.println(res.getEntity().getText());
 }


 public static class XXX4 extends Resource
 {

   public XXX4(Context context, Request req, Response res)
   {
     super(context, req, res);
     getVariants().add(new Variant(MediaType.TEXT_PLAIN));
System.out.println( req.getAttributes().get("x") );
   }
@Override
   public Representation getRepresentation(Variant variant)
   {
     return new StringRepresentation("hello");
   }
 }

}


begin:vcard
fn:Roger Menday
n:Menday;Roger
email;internet:[EMAIL PROTECTED]
tel;work:+49 (2461) 61-1588
x-mozilla-html:FALSE
version:2.1
end:vcard

Reply via email to