hi-nginx-java
a java web framework for hi-nginx:
- QUICK
- EASY
- FAST
dependence
- jdk 8+
components
- hi
- hi.request
- hi.response
- hi.route
- hi.servlet
- hi.lrucache
- hi.controller
- apache commons
- codec
- collections
- dbutils
- io
- lang
- math
- net
- rng
- text
- beanutils
- google
- gson
- msgpack
- mustache template engine
- config
install
make && sudo make install
hello world
package hi;
import hi.request;
import hi.response;
import hi.route;
import java.util.regex.Matcher;
public class helloworld implements hi.route.run_t {
public helloworld() {
}
public void handler(hi.request req, hi.response res, Matcher m) {
res.set_content_type("text/plain;charset=utf-8");
res.content = "hello,world\n";
res.status = 200;
}
}
location ~ \.java {
rewrite ^/(.*)\.java$ /$1 break;
hi_java_servlet hi/controller;
}
curl http://localhost/hi/helloworld.java
example
https://github.com/webcpp/jdemo