Package org.ontoware.jrest

Examples of org.ontoware.jrest.RestServer


import org.ontoware.jrest.response.RestResponse;

public class Adder {

  public static void main(String[] args) throws Exception {
    RestServer rs = new RestServer(8888);
    Adder adder = new Adder();
    rs.registerRestlet("add", adder);
    rs.start();
  }
View Full Code Here


   * after running this program.
   */
  public static void main(String[] args) throws Exception {
    //TODO explain in web we use Jetty here (what is jetty? what is a restful web server?)
    //TODO understand & explain what this "webroot" is & what so setup elsewhere to get jRest working ...
    RestServer rs = new RestServer(8888, "./step1");
    // default is RestServer rs = new RestServer(5555);
    // which stores content in "./web"
   
    // creating singleton instance:
    instance = new Step1();
   
    //TODO explain the concept Restlet
    rs.registerRestlet("add", instance);
    // to unregister Restlet: rs.unregisterRestlet("step1");
    rs.start();
    // to stop the RestServer: rs.stop();
   
    //TODO clear confusion about rs.run() & rs.start()
  }
View Full Code Here

 
  /*
   * run server with restlet
   */
  public static void main(String[] args) {
    RestServer rs = new RestServer(8889);
    instance = new Step2();
    rs.registerRestlet("mul", instance);
    try {
      rs.start();
    } catch (Exception e) {
      System.out.println(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.ontoware.jrest.RestServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.