为Servlet添加支持REST式URL ServletREST
- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: http://code.google.com/p/servletrest/
软件介绍
为Servlet添加支持REST式URL: 不改变习惯,仅仅在servlet内部完成doGet, doPost,doDelete,doPut等方法即可映射到较为复杂的REST URL
eg:
/book/head first java/
对应的URL表达式为:
/book/*/
/book/head first java/chapter/1
对应的URL表达式为:
/book/*/chapter/*
您所要做的: 仅仅需要在web.xml中配置一个filter 仅仅需要在集成HttpServlet添加一个注解(eg:@RestSupport("/book/*/chapter/*"))
下面附加一个使用示范:
@RestSupport("/book/*/chapter/*")
public class ChapterServlet extends HttpServlet {
private static final long serialVersionUID = -1534235656L;
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// code here ...
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// code here ...
}
protected void doPut(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// code here ...
}
protected void doDelete(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// code here ...
}
}
电脑报(上下册)
电脑报社 / 西南师范大学出版社 / 2006-12-01 / 45.00元
全套上、下两册,浓缩2006年电脑报精华文章。附录包含70余篇简明IT应用指南,覆盖软件、硬盘、数码、网络四大领域。配赠权威实用的2006-2007中国计算机年鉴DVD光盘,近1.4GB海量信息与资源超值奉献。8大正版超值软件,涵盖系统维护、系统安全、办公应用、多媒体娱乐等四大领域。微软、腾讯、友立等知名厂商,新年献礼。提供2006-2007全系列硬件、数码产品资讯,兼具知识性与资料性。官方网站全......一起来看看 《电脑报(上下册)》 这本书的介绍吧!
