Restlet学习
来源:互联网 发布:linux删除文件夹还存在 编辑:程序博客网 时间:2024/06/05 07:48
import org.restlet.Application;
import org.restlet.Component;
import org.restlet.Restlet;
import org.restlet.data.Protocol;
import org.restlet.routing.Router;
public class FirstStepsApplication extends Application {
public static void main(String[] args) throws Exception {
// Create a new Component.
Component component = new Component();
// Add a new HTTP server listening on port 8182.
component.getServers().add(Protocol.HTTP, 8183);
// Attach the sample application.
component.getDefaultHost().attach("/firstSteps",
new FirstStepsApplication());
// Start the component.
component.start();
}
/**
* Creates a root Restlet that will receive all incoming calls.
*/
@Override
public synchronized Restlet createInboundRoot() {
// Create a router Restlet that routes each call to a new instance of HelloWorldResource.
Router router = new Router(getContext());
// Defines only one route
router.attach("/context", FirstResouce.class);
return router;
}
}
---------------------------------------------------------------------------------
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class FirstResouce extends ServerResource{
@Get
public static String testGet() {
return "hello restlet";
}
}
- Restlet学习
- Restlet学习笔记1
- RESTLET框架学习
- Restlet学习资源
- restlet
- restlet
- Restlet
- Restlet 学习笔记 轻量级 restfull框架
- Restlet指南
- Restlet 指南
- restlet简介
- Restlet 第一步
- Restlet指南
- protobuf&restlet
- restlet简介
- Restlet overview
- Restlet 指南
- restlet学习心得
- Java IO流--字符流
- Learning!数组|Array
- Curl状态码列表
- android中使用LocationManager定位获取信息
- 【web基础2】别老打开百度了,自己做一个试试?
- Restlet学习
- python实现二维数组
- HDU 5360 Hiking(优先队列)2015 Multi-University Training Contest 6
- 杭电3787A+B
- HDU 1058Humble Numbers
- noip1996 砝码称重 - 提高组 (多重背包)
- 多校第六场 1011 hdu 5363Key Set(组合数学)
- linux_shell 特殊符号的介绍
- hdu 5358 First One 2015多校联合训练赛#6 枚举