1 Star 0 Fork 175

没什么好笑的 / blade

forked from hellokaton / blade 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README_EN.md 4.95 KB
一键复制 编辑 原始数据 按行查看 历史
王爵 提交于 2015-07-11 12:02 . Update README_EN.md

#Blade

a concise and powerful web development framework

中文

@biezhi on weibo Hex.pm Build Status release

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 or Fork, thanks!

Features

  • Simple MVC & Interceptor
  • REST API
  • Annotation way development
  • The microkernel IOC container
  • Utility class
  • A template engine support
  • Support JDK1.6 +
  • Jetty is started
  • Plug-in extension mechanism
  • ...

Quick start

First. Use maven to build a webapp, join dependency on the blade,Recommended for the latest version

<dependency>
	<groupId>com.bladejava</groupId>
	<artifactId>blade-core</artifactId>
	<version>1.2.1</version>
</dependency>

Second. Configuration in the web.xml Blade core filter initialization and set your class, and you can also not configuration(using jetty start)

<web-app>
	<display-name>Archetype Created Web Application</display-name>
	<filter>
		<filter-name>BladeFilter</filter-name>
		<filter-class>blade.BladeFilter</filter-class>
		<init-param>
			<param-name>applicationClass</param-name>
			<param-value>blade.sample.App</param-value>
		</init-param>
	</filter>
	
	<filter-mapping>
		<filter-name>BladeFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
</web-app>

Third. Write App.java and routing file, here is an example

public class App extends BladeApplication{

	Logger logger = Logger.getLogger(App.class);
	@Override
	public void init() {
		// Set up routing and interceptor bag in bag
		Blade.defaultRoute("blade.sample");
	}
	
}
@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:

Plan

1. Perfect the documents
2. Complete with `blade` single-user blog system development
3. Write English document
4. Optimize the code performance

Update

v1.2

1. Update Bug fix sql2o
2. Remove the blade-kit useless class
3. Add email support
4. Add a program timing
5. Add the HTTP request support network
6. Optimization of the built-in logging output
7. Add tasks to support regularly
8. Reconstruction project structure

v1.1.x

1. Remove excess public methods
2. Add the `Blade.run()` run jetty
3. Add the `Blade.register()` method register bean object
4. Optimize the ioc object management
5. Add initialization to monitor the context
6. Optimize the underlying IO
7. Simplify the plug-in extension
8. Matching vehicle routing separation
9. Repair jetty in running maven environment more bugs
10. Optimize the file upload
11. Optimized matching routing
12. Add methods perform monitoring
13. Add cache support

v1.0.0

The first stable release

licenses

Blade Framework based on the Apache2 License

Contact

OSC Blog:http://my.oschina.net/biezhi

Mail: biezhi.me#gmail.com

QQ Group: 1013565

1
https://gitee.com/xintao/blade.git
git@gitee.com:xintao/blade.git
xintao
blade
blade
master

搜索帮助