代码拉取完成,页面将自动刷新
package dswork.cms;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
/**
* 以SpringBoot方式运行时,如项目中有@WebServlet、@WebFilter、@WebListener需加上@ServletComponentScan({"package-name1", "package-name2"})
* 以SpringBoot方式运行时,可通过src/main/resources下的application.properties文件进行相关的配置(端口、context-path等)
*/
@SpringBootApplication
@ServletComponentScan({"dswork.cms", "common.cms", "dswork.sso"})
@ComponentScan({"common.cms"})
public class CmsSpringBootApplication
{
public static void main(String[] args)
{
SpringApplication.run(CmsSpringBootApplication.class, args);
}
@Bean
public InternalResourceViewResolver cmsViewResolver()
{
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setViewClass(CmsInternalResourceView.class); // 设置检查器
resolver.setContentType("text/html;charset=UTF-8");
resolver.setPrefix("/html");
resolver.setSuffix("");
resolver.setOrder(1);
return resolver;
}
// @Bean
// public FilterRegistrationBean<dswork.sso.WebFilter> buildWebFilter()
// {
// FilterRegistrationBean<dswork.sso.WebFilter> filterRegistrationBean = new FilterRegistrationBean<dswork.sso.WebFilter>();
// filterRegistrationBean.setOrder(1);
// filterRegistrationBean.setFilter(new dswork.sso.WebFilter());
// filterRegistrationBean.setName("websso");
// filterRegistrationBean.addUrlPatterns("/cms/*");
// return filterRegistrationBean;
// }
//
// @Bean
// public FilterRegistrationBean<dswork.authown.AuthOwnSSOFilter> buildAuthOwnSSOFilter()
// {
// FilterRegistrationBean<dswork.authown.AuthOwnSSOFilter> filterRegistrationBean = new FilterRegistrationBean<dswork.authown.AuthOwnSSOFilter>();
// filterRegistrationBean.setOrder(2);
// filterRegistrationBean.setFilter(new dswork.authown.AuthOwnSSOFilter());
// filterRegistrationBean.setName("authOwnSSOFilter");
// filterRegistrationBean.addUrlPatterns("/cms/*");
// return filterRegistrationBean;
// }
@Bean
public FilterRegistrationBean<dswork.authown.AuthOwnFilter> buildAuthOwnFilter()
{
FilterRegistrationBean<dswork.authown.AuthOwnFilter> filterRegistrationBean = new FilterRegistrationBean<dswork.authown.AuthOwnFilter>();
filterRegistrationBean.setOrder(2);
filterRegistrationBean.setFilter(new dswork.authown.AuthOwnFilter());
filterRegistrationBean.setName("authOwnFilter");
filterRegistrationBean.addUrlPatterns("/cms/*");
return filterRegistrationBean;
}
// @Bean
// @SuppressWarnings("all")
// public org.springframework.boot.web.servlet.ServletListenerRegistrationBean servletListenerRegistrationBean()
// {
// org.springframework.boot.web.servlet.ServletListenerRegistrationBean servletListenerRegistrationBean = new org.springframework.boot.web.servlet.ServletListenerRegistrationBean();
// servletListenerRegistrationBean.setListener(new se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventor());
// return servletListenerRegistrationBean;
// }
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。