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
}
你必须知道的495个C语言问题
Steve Summit / 孙云、朱群英 / 人民邮电出版社 / 2009-2 / 45.00元
“本书是Summit以及C FAQ在线列表的许多参与者多年心血的结晶,是C语言界最为珍贵的财富之一。我向所有C语言程序员推荐本书。” ——Francis Glassborow,著名C/C++专家,ACCU(C/C++用户协会)前主席 “本书清晰阐明了Kernighan与Ritchie《The C programming Language》一书中许多简略的地方,而且精彩地总结了C语言编程......一起来看看 《你必须知道的495个C语言问题》 这本书的介绍吧!
