# blade
**Repository Path**: stc/blade
## Basic Information
- **Project Name**: blade
- **Description**: blade 是一个简洁强大的web框架,它内置了IOC管理,拦截器配置,REST API开发等众多主流web特性,集成了模板引擎,缓存插件,数据库操作,邮件发送,HTTP请求等常用功能
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: http://bladejava.com
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 167
- **Created**: 2015-08-18
- **Last Updated**: 2024-11-23
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#Blade
[](http://bladejava.com)
[中文](https://github.com/biezhi/blade/blob/master/README_CN.md)
[](http://weibo.com/u/5238733773)
[](http://www.apache.org/licenses/LICENSE-2.0.html)
[](https://travis-ci.org/biezhi/blade)
[](https://circleci.com/gh/biezhi/blade/tree/master)
[](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.bladejava%22)
## Introduction
**blade** Is a concise and powerful web development framework, it is built into the `IOC` administration, the interceptor configuration, `REST API` development and so on many mainstream web features, integrate the template engine, a cache plug-in, database operations, commonly used functions such as email, concise source deserves your reading. If you like it, can be [Star and Fork](https://github.com/biezhi/blade), thanks!
## Features
* Simple MVC
* Restful
* Multiple routing configuration
* Micro kernel IOC container
* Utility class
* Coding/JSON/configuration file
* JDK1.6 +
* Plug-in extension mechanism
* Template engine Plugin
* Cache Plugin
* The source code of less than 100kb
## Quick start
First. Use maven to build a webapp, join dependency on the blade,Recommended for the [latest version](LAST_VERSION.md)
```xml
com.bladejava
blade-core
1.2.7-alpha
```
Second. Configuration in the `web.xml` Blade core filter initialization and set your class, and you can also not configuration(using jetty start)
```xml
BladeFilter
blade.BladeFilter
applicationClass
hello.App
BladeFilter
/*
```
Third. Write App.java and routing file, here is an example
```java
public class App extends BladeApplication{
Logger logger = Logger.getLogger(App.class);
@Override
public void init() {
// register router
Blade.regRoute("/hello", SayHi.class, "hello");
// anonymous router,java8 so simple
Blade.get("/get", new RouteHandler() {
@Override
public String run(Request request, Response response) {
System.out.println("come get!!");
System.out.println(request.query("name"));
return "get";
}
});
}
}
```
#### Functional router
```java
public class SayHi {
public String hello(Request request, Response response){
System.out.println("come hello~");
request.attribute("name", "rose baby");
return "hi";
}
}
```
#### Annotations router
```java
@Path("/")
public class Hello {
@Route("hello")
public String hello() {
System.out.println("hello");
return "hello.jsp";
}
@Route(value = "post", method = HttpMethod.POST)
public void post(Request request) {
String name = request.query("name");
System.out.println("name = " + name);
}
@Route("users/:name")
public ModelAndView users(Request request, Response response) {
System.out.println("users");
String name = request.pathParam(":name");
ModelAndView modelAndView = new ModelAndView("users");
modelAndView.add("name", name);
return modelAndView;
}
@Route("index")
public String index(Request request) {
request.attribute("name", "jack");
return "index.jsp";
}
}
```
OK, all this may seem simple, refer to the guidelines for use more ready-made examples for your reference:
+ [hello project](https://github.com/bladejava/hello)
+ [api docs](http://bladejava.com/apidocs/)
+ [user guide](https://github.com/biezhi/blade/wiki)
+ [some examples](https://github.com/bladejava)
## Plan
1. Improve the document
2. Single user blog system development
3. web chat system
4. Optimize the code performance
## Update
[update log](https://github.com/biezhi/blade/blob/master/UPDATE_LOG.md)
## licenses
Blade Framework based on the [Apache2 License](http://www.apache.org/licenses/LICENSE-2.0.html)
## Contact
OSC Blog:[http://my.oschina.net/biezhi](http://my.oschina.net/biezhi)
Mail: biezhi.me#gmail.com
QQ Group: [1013565](http://shang.qq.com/wpa/qunwpa?idkey=932642920a5c0ef5f1ae902723c4f168c58ea63f3cef1139e30d68145d3b5b2f)