Blade-simple and powerful javaweb framework

Source: Internet
Author: User

Blade-simple and powerful javaweb framework
Blade

 

BladeIs a simple and powerful web framework, which has built-inIOCManagement, interceptor configuration,REST APIMany 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.xmlConfigure 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.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.