没有合适的资源?快使用搜索试试~ 我知道了~
首页Building a Rest API with Spring
资源详情
资源评论
资源推荐
Building a
REST API with
Page 2 / 113
Building a REST API with
TABLE OF CONTENTS
1: BOOTSTRAP A WEB APPLICATION WITH SPRING 4
2: BUILD A REST API WITH SPRING 4 AND JAVA CONFIG
3: SPRING SECURITY FOR A REST API
4: SPRING SECURITY BASIC AUTHENTICATION
5: SPRING SECURITY DIGEST AUTHENTICATION
6: BASIC AND DIGEST AUTHENTICATION FOR A REST SERVICE
WITH SPRING SECURITY
7: HTTP MESSAGE CONVERTERS WITH THE SPRING FRAMEWORK
8: REST API DISCOVERABILITY AND HATEOAS
9: HATEOAS FOR A SPRING REST SERVICE
10: ETAGS FOR REST WITH SPRING
11: REST PAGINATION IN SPRING
12: ERROR HANDLING FOR REST WITH SPRING
13: VERSIONING A REST API
14: TESTING REST WITH MULTIPLE MIME TYPESA
Page 3 / 113
Building a REST API with
1: BOOTSTRAP A WEB APPLICATION WITH SPRING 4
1. Overview ............. ..........................................................................................................................................................................11
2. The Maven pom.xml ....................................................................................................................................................11
2.1. The
cglib
dependency before Spring 3.2 ...................................................................................................... 12
2.2. The
cglib
dependency in Spring 3.2 and beyond ....................................................................................... 13
3. The Java based Web Configuration ..................................................................................................................... 13
3.1. The web.xml .. ......................................................................................................................................................................... 15
4. Conclusion ....... ......................................................................................................................................................................... 16
2: BUILD A REST API WITH SPRING 4 AND JAVA
CONFIG
1. Overview ............. ......................................................................................................................................................................... 18
2. Understanding REST in Spring .................................................................................................................................... 18
3. The Java Configuration ................................................................................................................................................... 19
4. Testing the Spring Context .................................................................................................................................... 19
5. The Controller .. ......................................................................................................................................................................... 20
6. Mapping the HTTP response codes ..................................................................................................................... 21
6.1. Unmapped Requests ................................................................................................................................................... 21
6.2. Valid, Mapped Requests ...................................................................................................................................................22
6.3. Client Error .... ......................................................................................................................................................................... 22
6.4. Using
@ExceptionHandler
....................................................................................................................................22
Page 4 / 113
Building a REST API with
7. Additional Maven dependencies ................................................................................................................................ 23
8. Conclusion ....... ..................................................................................................................................................................... 24
3: SPRING SECURITY FOR A REST API
1. Overview ............. ..................................................................................................................................................................... 26
2. Spring Security in the
web.xml
................................................................................................................................ 26
3. The Security Configuration ................................................................................................................................ 27
3.2. The Entry Point .............................................................................................................................................................. 28
3.3. The Login Form for REST ................................................................................................................................ 29
3.4. Authentication should return 200 instead of 301 ...................................................................................29
3.5. Failed Authentication should return 401 instead of 302 ....................................................................30
3.6. The Authentication Manager and Provider ...................................................................................................31
3.7 Finally – Authentication against the running REST Service .....................................................................31
4. Maven and other trouble ...............................................................................................................................................32
5. Conclusion ....... .....................................................................................................................................................................32
4: SPRING SECURITY BASIC AUTHENTICATION
1. Overview ............. ..................................................................................................................................................................... 34
2. The Spring Security Configuration .................................................................................................................34
3. Consuming The Secured Application ................................................................................................................. 35
4. Further Configuration – The Entry Point .................................................................................................................36
Page 5 / 113
Building a REST API with
5. The Maven Dependencies ...................................................................................................................................................37
6. Conclusion ....... .........................................................................................................................................................................38
5: SPRING SECURITY DIGEST AUTHENTICATION
1. Overview ............. .........................................................................................................................................................................40
2. The Security XML Configuration ....................................................................................................................................40
3. Consuming the Secured Application .....................................................................................................................42
4. The Maven Dependencies ...................................................................................................................................................43
5. Conclusion ....... ........................................................................................................................................................................ 44
6: BASIC AND DIGEST AUTHENTICATION FOR A
REST SERVICE WITH SPRING SECURITY
1. Overview ............. ........................................................................................................................................................................ 46
2. Configuration of Basic Authentication .................................................................................................................... 46
2.1. Satisfying the stateless constraint – getting rid of sessions ........................................................................47
3. Configuration of Digest Authentication .....................................................................................................................47
4. Supporting both authentication protocols in the same RESTful service ......................................... 48
4.1. Anonymous request .................................................................................................................................................. 49
4.2. Request with authentication credentials ..................................................................................................... 49
5. Testing both scenarios .................................................................................................................................................. 49
6. Conclusion ....... .........................................................................................................................................................................50
剩余112页未读,继续阅读
ralphvsclark
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2022年中国足球球迷营销价值报告.pdf
- 房地产培训 -营销总每天在干嘛.pptx
- 黄色简约实用介绍_汇报PPT模板.pptx
- 嵌入式系统原理及应用:第三章 ARM编程简介_3.pdf
- 多媒体应用系统.pptx
- 黄灰配色简约设计精美大气商务汇报PPT模板.pptx
- 用matlab绘制差分方程Z变换-反变换-zplane-residuez-tf2zp-zp2tf-tf2sos-sos2tf-幅相频谱等等.docx
- 网络营销策略-网络营销团队的建立.docx
- 电子商务示范企业申请报告.doc
- 淡雅灰低面风背景完整框架创业商业计划书PPT模板.pptx
- 计算模型与算法技术:10-Iterative Improvement.ppt
- 计算模型与算法技术:9-Greedy Technique.ppt
- 计算模型与算法技术:6-Transform-and-Conquer.ppt
- 云服务安全风险分析研究.pdf
- 软件工程笔记(完整版).doc
- 电子商务网项目实例规划书.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0