Hello,

I need to use a command line argument in a server resource.  What's
the best way to get this done when the server resource is in a
separate class?

public class RestApp {
 public static void main(String[] args) throws Exception {
 Component c = new Component();
 c.getServers().add(Protocol.HTTP, "8182");
 c.getDefaultHost().attach(new RhapsodyANTRouter());

 // NEED to pass command line argument to ServerResource called AppResource

 c.start();
 }
}

public class RestAppRouter extends Application {
 @Override
 public synchronized Restlet createInboundRoot() {
 Router r = new Router(getContext());
 r.attach("/test", ResourceStatus.class);
 return r;
 }
}

public class AppResource extends ServerResource {
 @Post
 public String processPost(Form f) throws Exception {
 // NEED to use command line argument here
 }
}

Thank you.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2708895

Reply via email to