Package org.ontoware.semweb4j.lessons.lesson99

Source Code of org.ontoware.semweb4j.lessons.lesson99.Adder

package org.ontoware.semweb4j.lessons.lesson99;

import org.ontoware.jrest.RestParams;
import org.ontoware.jrest.RestServer;
import org.ontoware.jrest.annotation.RestAddressByParameter;
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();
  }

  public RestResponse get(@RestAddressByParameter("one")
  int a, @RestAddressByParameter("two")
  int b) {
    return new RestResponse("<html><h2>" + (a + b)+"</h2>", RestParams.MIME_TEXT_HTML, 200,
        null, null);
  }
 
 

}
TOP

Related Classes of org.ontoware.semweb4j.lessons.lesson99.Adder

TOP
Copyright © 2018 www.massapi.com. 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.