Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/downgoon/jresty
a tranditional but rapid development RESTful API framework based on Struts2 and Spring
https://github.com/downgoon/jresty
jresty rest-api ssh
Last synced: 19 days ago
JSON representation
a tranditional but rapid development RESTful API framework based on Struts2 and Spring
- Host: GitHub
- URL: https://github.com/downgoon/jresty
- Owner: downgoon
- Created: 2016-12-18T08:00:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T10:56:41.000Z (about 7 years ago)
- Last Synced: 2024-10-10T20:54:16.291Z (about 1 month ago)
- Topics: jresty, rest-api, ssh
- Language: Java
- Size: 244 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jresty
- jresty-rest-example
- jresty-rest- jresty-data-orm
- jresty-data-cache
- jresty-data-http- jresty-commons
- jresty-security
---
# jresty-rest-example
[hello-world-jresty](https://github.com/downgoon/hello-world-jresty): a quick start example
## how to run
- **run in eclipse**
org.example.jresty.runner.JettyEmbedRunner
- **run with maven**
// in rd env (development environment)
mvn -Djetty.port=8080 jetty:run -Dmaven.test.skip=true -Prd
// in op env (production environment)
mvn -Djetty.port=8080 jetty:run -Pop
## how to access## multi representation
curl http://localhost:8080/jresty/ping.json -i
curl http://localhost:8080/jresty/ping.jsonp -i
curl http://localhost:8080/jresty/ping.xml -i
curl http://localhost:8080/jresty/ping.html -i
curl http://localhost:8080/jresty/ping.jsp -i
# redirect support for .html|.jsp
http://localhost:8080/jresty/ping.jsp?redirect=http://www.baidu.com
http://localhost:8080/jresty/ping.html?redirect=http://www.baidu.com
## two URLs for one method
# GET ping.json is equal to GET ping-index.json
# POST ping.json is equal to GET ping-create.json
# DELETE ping.json is equal to GET ping-remove.json
# PUT ping.json is equal to GET ping-update.json
# GET ping/ABC.json is equal to GET ping-view.json?id=ABCcurl http://localhost:8080/jresty/ping.json -i
curl http://localhost:8080/jresty/ping-index.json -i
## some examples
$ curl http://localhost:8080/jresty/ping.json -i
HTTP/1.1 200 OK
Content-Language: zh-cn
Access-Control-Allow-Origin: *
Content-Length: 97
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0
Server: Jetty(7.2.0.v20101020)
$ curl http://localhost:8080/jresty/ping.xml -i
HTTP/1.1 200 OK
Content-Language: zh-cn
Access-Control-Allow-Origin: *
Content-Length: 200
Content-Type: application/xml;charset=UTF-8
Cache-Control: max-age=0
Server: Jetty(7.2.0.v20101020)
200
OK
20161218152559257318:系统正在运行