Blade-simple and powerful javaweb framework
Blade
BladeIs a simple and powerful web framework, which has built-inIOC
Management, interceptor configuration,REST API
Many mainstream web features such as development integrate common functions such as template engine, cache plug-ins, database operations, and email sending. The concise source code is worth reading and learning. If you like, welcome to Star and Fork!
Blade features simple MVC & interceptor REST style API annotation method development microkernel IOC container utility tool class template engine support JDK1.6 + Built-in Jetty start plug-in extension mechanism... Quick Start
Step 1: Use maven to build a webapp and add the blade dependency. We recommend that you get the latest version.
com.bladejava
blade
x.x.x
Step 2:web.xml
Configure the Blade core filter and set your initialization class. You can also disable the configuration (start with jetty)
Archetype Created Web Application
BladeFilter
blade.BladeFilter
applicationClass
blade.sample.App
BladeFilter
/*
Step 3: Compile the App. java and routing files. The following is an example.
Public class App extends BladeApplication {Logger logger = Logger. getLogger (App. class); @ Override public void init () {// sets the package Blade where the route and interceptor package is located. defaultRoute (blade. sample );}}
@Pathpublic 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; }}
Okay, how simple it looks. Please refer to the user guide for more examples:
Blade User Guide (improving ...)
Some examples: https://github.com/bladejava
Update log v1.1.2
1. Optimized sql2o Support 2. removed blade-kit useless class 3. Added mail support 4. Added program timing support 5. Added http network request support
V1.1.0
1. remove unnecessary methods for making public 2. add 'Blade. run () 'to run jetty3. add 'Blade. the register () 'method registers bean objects. 4. optimized IOC Object Management 5. optimized underlying IO6. simplified plug-in extension 7. interceptor route matching and separation 8. fixed jetty running bug 9 in multiple maven environments. added the initialization listener context10. optimized File Upload 11. optimized route matching 12. add method execution monitoring 13. add cache support
V1.0.0
First stable version released
Open source Protocol
The Blade framework is based on Apache2 License.