RESTful接口实现 Fulworx
- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: http://code.google.com/p/fulworx/
- 软件文档: http://code.google.com/p/fulworx/wiki/V2p1Documentation
软件介绍
Fulworx 通过一个简单的 Annotations 为 XWork 框架的 Action 增加了输出 RESTful 接口的功能,如下代码所示:
@URITemplate(uri="/someURI/user/{lastname}/{firstname}")
@Accessor("user")
public class UserAction implements CreateAction, ReadAction
{
private User user;
private String firstname;
private String lastname;
private UserService userService;
public UserAction(UserService service){
this.userService=service;
}
public String create()
{
user = this.userService.create(firstname,
lastname,
user.getEmail(),
user.getPhone());
if(user == null){
//if user isn't found, insert firstname and lastname into
//resource bundle message, and return a 404 status code
throw new ApplicationException(
new BundledErrorDetail("user.error.notfound",
ResourceBundle.getBundle("ErrorMessages"),
new Object[]{firstname, lastname}),
404);
}
return SUCCESS;
}
public String read()
{
user = this.userService.read(firstname, lastname);
return SUCCESS;
}
public User getUser()
{
return user;
}
public void setUser(User user)
{
this.user = user;
}
//also, getter / setter for firstname, lastname
}
数据结构、算法与应用
(美)Sartaj Sahni / 汪诗林、孙晓东、等 / 机械工业出版社 / 2000-01 / 49.00
本书是关于计算机科学与工程领域的基础性研究科目之一――数据结构与算法的专著。 本书在简要回顾了基本的C++ 程序设计概念的基础上,全面系统地介绍了队列、堆栈、树、图等基本数据结构,以及贪婪算法、分而治之算法、分枝定界算法等多种算法设计方法,为数据结构与算法的继续学习和研究奠定了一个坚实的基础。更为可贵的是,本书不仅仅介绍了理论知识,还提供了50多个应用实例及600多道练习题。 本书......一起来看看 《数据结构、算法与应用》 这本书的介绍吧!
