Package org.resthub.web.springmvc.router.javaconfig

Source Code of org.resthub.web.springmvc.router.javaconfig.WebAppConfig

package org.resthub.web.springmvc.router.javaconfig;

import org.resthub.web.springmvc.router.RouterConfigurationSupport;
import org.resthub.web.springmvc.router.RouterHandlerMapping;
import org.resthub.web.springmvc.router.support.TeapotHandlerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import java.util.ArrayList;
import java.util.List;

@Configuration
@ComponentScan(basePackages = "org.resthub.web.springmvc.router.controllers")
public class WebAppConfig extends RouterConfigurationSupport {

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new TeapotHandlerInterceptor());
    }

    @Override
    public List<String> listRouteFiles() {

        List<String> routeFiles = new ArrayList<String>();
        routeFiles.add("mappingroutes.conf");

        return routeFiles;
    }
}
TOP

Related Classes of org.resthub.web.springmvc.router.javaconfig.WebAppConfig

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.