convert to spring boot project
This commit is contained in:
@@ -1,55 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-module-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>JeeSite Module Core</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-framework</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-module-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>JeeSite Module Core</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-framework</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.spring;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
|
||||
import org.apache.shiro.cache.CacheManager;
|
||||
import org.apache.shiro.cas.CasSubjectFactory;
|
||||
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
|
||||
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
|
||||
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.shiro.cas.CasOutHandler;
|
||||
import com.jeesite.common.shiro.config.FilterChainDefinitionMap;
|
||||
import com.jeesite.common.shiro.filter.CasAuthenticationFilter;
|
||||
import com.jeesite.common.shiro.filter.FormAuthenticationFilter;
|
||||
import com.jeesite.common.shiro.filter.PermissionsAuthorizationFilter;
|
||||
import com.jeesite.common.shiro.filter.UserFilter;
|
||||
import com.jeesite.common.shiro.realm.AuthorizingRealm;
|
||||
import com.jeesite.common.shiro.session.SessionDAO;
|
||||
import com.jeesite.common.shiro.session.SessionManager;
|
||||
import com.jeesite.common.shiro.web.ShiroFilterFactoryBean;
|
||||
import com.jeesite.common.shiro.web.WebSecurityManager;
|
||||
import com.jeesite.modules.sys.service.EmpUserService;
|
||||
import com.jeesite.modules.sys.service.UserService;
|
||||
|
||||
/**
|
||||
* Shiro配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Configuration
|
||||
public class ShiroConfig {
|
||||
|
||||
/**
|
||||
* 单点登录信息句柄,单点退出用
|
||||
*/
|
||||
@Bean
|
||||
public CasOutHandler casOutHandler() {
|
||||
return new CasOutHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统安全认证实现类
|
||||
*/
|
||||
@Bean
|
||||
public AuthorizingRealm authorizingRealm(SessionDAO sessionDAO, UserService userService,
|
||||
EmpUserService empUserService, CasOutHandler casOutHandler) {
|
||||
AuthorizingRealm bean = new AuthorizingRealm();
|
||||
bean.setCachingEnabled(false);
|
||||
bean.setSessionDAO(sessionDAO);
|
||||
bean.setUserService(userService);
|
||||
bean.setEmpUserService(empUserService);
|
||||
bean.setCasOutHandler(casOutHandler);
|
||||
bean.setCasServerUrl(Global.getProperty("shiro.casServerUrl"));
|
||||
bean.setCasServerCallbackUrl(Global.getProperty("shiro.casClientUrl") + Global.getAdminPath() + "/login-cas");
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* CAS登录过滤器
|
||||
*/
|
||||
@Bean
|
||||
public CasAuthenticationFilter shiroCasFilter(AuthorizingRealm authorizingRealm) {
|
||||
CasAuthenticationFilter bean = new CasAuthenticationFilter();
|
||||
bean.setAuthorizingRealm(authorizingRealm);
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form登录过滤器
|
||||
*/
|
||||
@Bean
|
||||
public FormAuthenticationFilter shiroAuthcFilter(AuthorizingRealm authorizingRealm) {
|
||||
FormAuthenticationFilter bean = new FormAuthenticationFilter();
|
||||
bean.setAuthorizingRealm(authorizingRealm);
|
||||
return bean;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 登出过滤器
|
||||
// */
|
||||
// @Bean
|
||||
// public LogoutFilter shiroLogoutFilter() {
|
||||
// return new LogoutFilter();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 权限字符串过滤器
|
||||
*/
|
||||
@Bean
|
||||
public PermissionsAuthorizationFilter shiroPermsFilter() {
|
||||
return new PermissionsAuthorizationFilter();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 角色权限过滤器
|
||||
// */
|
||||
// @Bean
|
||||
// public RolesAuthorizationFilter shiroRolesFilter() {
|
||||
// return new RolesAuthorizationFilter();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 用户权限过滤器
|
||||
*/
|
||||
@Bean
|
||||
public UserFilter shiroUserFilter() {
|
||||
return new UserFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
* URL过滤定义
|
||||
*/
|
||||
@Bean
|
||||
public FilterChainDefinitionMap shiroFilterChainDefinitionMap() {
|
||||
FilterChainDefinitionMap bean = new FilterChainDefinitionMap();
|
||||
bean.setFilterChainDefinitions(Global.getProperty("shiro.filterChainDefinitions"));
|
||||
bean.setDefaultFilterChainDefinitions(Global.getProperty("shiro.defaultFilterChainDefinitions"));
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shiro认证过滤器
|
||||
*/
|
||||
@Bean
|
||||
public ShiroFilterFactoryBean shiroFilter(WebSecurityManager securityManager, CasAuthenticationFilter shiroCasFilter,
|
||||
FormAuthenticationFilter shiroAuthcFilter,
|
||||
// LogoutFilter shiroLogoutFilter,
|
||||
PermissionsAuthorizationFilter shiroPermsFilter,
|
||||
// RolesAuthorizationFilter shiroRolesFilter,
|
||||
UserFilter shiroUserFilter, FilterChainDefinitionMap shiroFilterChainDefinitionMap) {
|
||||
ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
|
||||
bean.setSecurityManager(securityManager);
|
||||
bean.setLoginUrl(Global.getProperty("shiro.loginUrl"));
|
||||
bean.setSuccessUrl(Global.getProperty("shiro.successUrl"));
|
||||
Map<String, Filter> filters = bean.getFilters();
|
||||
filters.put("cas", shiroCasFilter);
|
||||
filters.put("authc", shiroAuthcFilter);
|
||||
// filters.put("logout", shiroLogoutFilter);
|
||||
filters.put("perms", shiroPermsFilter);
|
||||
// filters.put("roles", shiroRolesFilter);
|
||||
filters.put("user", shiroUserFilter);
|
||||
bean.setFilterChainDefinitionMap(shiroFilterChainDefinitionMap.getObject());
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义Shiro安全管理配置
|
||||
*/
|
||||
@Bean
|
||||
public WebSecurityManager securityManager(AuthorizingRealm authorizingRealm, SessionManager sessionManager, CacheManager shiroCacheManager) {
|
||||
WebSecurityManager bean = new WebSecurityManager();
|
||||
bean.setRealm(authorizingRealm);
|
||||
bean.setSessionManager(sessionManager);
|
||||
bean.setCacheManager(shiroCacheManager);
|
||||
// 设置支持CAS的subjectFactory
|
||||
bean.setSubjectFactory(new CasSubjectFactory());
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +80,7 @@ jdbc:
|
||||
redis:
|
||||
|
||||
# 是否启用 Redis
|
||||
enable: false
|
||||
enabled: false
|
||||
|
||||
# Redis 连接参数
|
||||
host: 192.168.11.12
|
||||
@@ -101,14 +101,6 @@ redis:
|
||||
# 是否启用Redis系统缓存及会话
|
||||
cacheAndSession: false
|
||||
|
||||
# Mapper文件刷新线程
|
||||
mapperRefresh:
|
||||
|
||||
enabled: true
|
||||
delaySeconds: 60
|
||||
sleepSeconds: 3
|
||||
mappingPath: mappings
|
||||
|
||||
#============================#
|
||||
#===== System settings ======#
|
||||
#============================#
|
||||
@@ -131,6 +123,12 @@ frontPath: /f
|
||||
#索引页路径
|
||||
defaultPath: ${adminPath}/login
|
||||
|
||||
# 分页配置
|
||||
page:
|
||||
|
||||
# 分页默认大小
|
||||
pageSize: 20
|
||||
|
||||
# 用户相关参数
|
||||
user:
|
||||
|
||||
@@ -185,12 +183,6 @@ user:
|
||||
# 集团模式(多公司、多租户、SAAS模式)
|
||||
useCorpModel: false
|
||||
|
||||
# 分页配置
|
||||
page:
|
||||
|
||||
# 分页默认大小
|
||||
pageSize: 20
|
||||
|
||||
# 任务调度
|
||||
job:
|
||||
|
||||
@@ -311,6 +303,14 @@ mybatis:
|
||||
# 扫描基础包设置(Aliases、@MyBatisDao),如果多个,用“,”分隔
|
||||
scanBasePackage: com.jeesite.modules
|
||||
|
||||
# Mapper文件刷新线程
|
||||
mapper:
|
||||
refresh:
|
||||
enabled: true
|
||||
delaySeconds: 60
|
||||
sleepSeconds: 3
|
||||
mappingPath: mappings
|
||||
|
||||
# 缓存设置
|
||||
ehcache:
|
||||
|
||||
@@ -321,6 +321,11 @@ ehcache:
|
||||
# 清理缓存的缓存名称
|
||||
clearNames: sysCache,userCache,corpCache,cmsCache,pageCachingFilter
|
||||
|
||||
# 页面缓存配置
|
||||
pageCaching:
|
||||
enabled: false
|
||||
urlPatterns: "*.html"
|
||||
|
||||
# Web 相关
|
||||
web:
|
||||
|
||||
@@ -332,6 +337,17 @@ web:
|
||||
# 引入页面为不:'/themes/'+themeName+'/include/footer.html'
|
||||
themeName: default
|
||||
|
||||
# MVC 拦截器
|
||||
interceptor:
|
||||
|
||||
# 后台管理日志记录拦截器
|
||||
log:
|
||||
enabled: true
|
||||
|
||||
# 前台自动切换到手机视图拦截器
|
||||
mobile:
|
||||
enabled: false
|
||||
|
||||
# 静态文件后缀,过滤静态文件,以提高访问性能。
|
||||
staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Spring Configuration</description>
|
||||
|
||||
<!-- 加载配置属性文件(谁先加载,谁优先级越高,jeesite.yml的优先级高于jeesite-core.yml)-->
|
||||
<bean id="yamlProperties" class="org.springframework.beans.factory.config.YamlPropertiesFactoryBean">
|
||||
<property name="resources">
|
||||
<array><value>classpath:jeesite-core.yml</value>
|
||||
<value>classpath:jeesite.yml</value></array>
|
||||
</property>
|
||||
</bean>
|
||||
<context:property-placeholder properties-ref="yamlProperties" ignore-unresolvable="true"/>
|
||||
|
||||
<!-- Spring Application Context Holder -->
|
||||
<bean id="springUtils" class="com.jeesite.common.utils.SpringUtils" lazy-init="false"></bean>
|
||||
|
||||
<!-- 生成唯一性ID工具 -->
|
||||
<bean id="idGen" class="com.jeesite.common.idgen.IdGen" lazy-init="false"></bean>
|
||||
|
||||
<!-- 数据库自动升级程序 -->
|
||||
<bean id="dbUpgrade" class="com.jeesite.common.db.DbUpgrade" lazy-init="false"></bean>
|
||||
|
||||
<!-- 配置国际化资源文件路径 -->
|
||||
<bean id="messageSource" class="com.jeesite.common.i18n.I18nMessageSource"
|
||||
depends-on="springUtils">
|
||||
</bean>
|
||||
|
||||
<!-- 基于Cookie和Session的本地化解析器 -->
|
||||
<bean id="localeResolver" class="com.jeesite.common.i18n.I18nLocaleResolver">
|
||||
<property name="defaultLocale" value="zh_CN" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置 JSR303 Bean Validator 定义 -->
|
||||
<bean id="beanValidator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
|
||||
<property name="providerClass" value="org.hibernate.validator.HibernateValidator"/>
|
||||
</bean>
|
||||
|
||||
<!-- 缓存配置 -->
|
||||
<bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
|
||||
<property name="configLocation" value="classpath:${ehcache.configFile}" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Spring Redis Configuration</description>
|
||||
|
||||
<!-- Druid Spring 监控拦截器 ,开启后部分@Transactional声明式事务会失效,暂时还没找到原因 -->
|
||||
<bean id="druidStatInterceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor" />
|
||||
<bean id="druidStatPointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">
|
||||
<property name="patterns"><list>
|
||||
<value>com.jeesite..*.service..*.*</value>
|
||||
</list></property>
|
||||
<property name="excludedPatterns"><list>
|
||||
<value>com.jeesite..*.service..*Dao.*</value>
|
||||
</list></property>
|
||||
</bean>
|
||||
<aop:config proxy-target-class="true">
|
||||
<aop:advisor advice-ref="druidStatInterceptor" pointcut-ref="druidStatPointcut" />
|
||||
</aop:config>
|
||||
|
||||
</beans>
|
||||
@@ -1,112 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>MyBatis Configuration</description>
|
||||
|
||||
<!-- MyBatis SqlSessionFactoryBean -->
|
||||
<bean id="sqlSessionFactory" class="com.jeesite.common.mybatis.SqlSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="typeAliasesPackage" ref="mybatisScanBasePackage"/>
|
||||
<property name="typeAliasesSuperType" value="com.jeesite.common.entity.BaseEntity"/>
|
||||
<property name="mapperLocations" value="classpath*:/mappings/**/*.xml"/>
|
||||
<property name="configLocation" value="classpath:/mybatis/mybatis-config.xml"/>
|
||||
<property name="configurationProperties"><props>
|
||||
<prop key="_prefix">${jdbc.tablePrefix}</prop>
|
||||
</props></property>
|
||||
</bean>
|
||||
|
||||
<!-- 扫描basePackage下所有以@MyBatisDao注解的接口 -->
|
||||
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
|
||||
<property name="basePackage" ref="mybatisScanBasePackage"/>
|
||||
<property name="annotationClass" value="com.jeesite.common.mybatis.annotation.MyBatisDao"/>
|
||||
</bean>
|
||||
|
||||
<!-- 定义事务 -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置 Annotation 驱动,扫描@Transactional注解的类定义事务 -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
|
||||
|
||||
<!-- 多数据源配置 -->
|
||||
<bean id="dataSource" class="com.jeesite.common.datasource.RoutingDataSource" primary="true">
|
||||
<property name="targetDataSources">
|
||||
<map key-type="java.lang.String"></map>
|
||||
</property>
|
||||
<property name="defaultTargetDataSource" ref="defaultDataSource"/>
|
||||
</bean>
|
||||
|
||||
<!-- 默认数据源配置, 使用 Druid 数据库连接池 -->
|
||||
<bean id="defaultDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
|
||||
<!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
|
||||
<property name="driverClassName" value="${jdbc.driver}" />
|
||||
|
||||
<!-- 基本属性 url、user、password -->
|
||||
<property name="url" value="${jdbc.url}" />
|
||||
<property name="username" value="${jdbc.username}" />
|
||||
<property name="password" value="${jdbc.password}" />
|
||||
|
||||
<!-- 配置初始化大小、最小、最大 -->
|
||||
<property name="initialSize" value="${jdbc.pool.init}" />
|
||||
<property name="minIdle" value="${jdbc.pool.minIdle}" />
|
||||
<property name="maxActive" value="${jdbc.pool.maxActive}" />
|
||||
|
||||
<!-- 配置获取连接等待超时的时间 -->
|
||||
<property name="maxWait" value="60000" />
|
||||
|
||||
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
|
||||
<property name="timeBetweenEvictionRunsMillis" value="60000" />
|
||||
|
||||
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
|
||||
<property name="minEvictableIdleTimeMillis" value="300000" />
|
||||
|
||||
<!-- 泄露的连接可以被删除的超时值,单位秒
|
||||
<property name="removeAbandoned" value="true" />
|
||||
<property name="removeAbandonedTimeout" value="1800" />-->
|
||||
|
||||
<!-- 是否检测空闲超时。如果超时,则会被移除 -->
|
||||
<property name="testWhileIdle" value="true" />
|
||||
<property name="testOnBorrow" value="false" />
|
||||
<property name="testOnReturn" value="false" />
|
||||
<property name="validationQuery" value="${jdbc.testSql}" />
|
||||
|
||||
<!-- 打开PSCache,并且指定每个连接上PSCache的大小(Oracle使用)
|
||||
<property name="poolPreparedStatements" value="true" />
|
||||
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> -->
|
||||
|
||||
<!-- 配置监控统计拦截的filters -->
|
||||
<property name="filters" value="stat" />
|
||||
|
||||
<!-- 配置自定义的拦截器 -->
|
||||
<property name="proxyFilters">
|
||||
<list>
|
||||
<bean class="com.jeesite.common.datasource.filter.ConfigFilter" />
|
||||
</list>
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
<!-- 数据源配置, 使用应用服务器的数据库连接池
|
||||
<jee:jndi-lookup id="defaultDataSource" jndi-name="java:comp/env/jdbc/jeesite" />-->
|
||||
|
||||
<!-- 数据源配置, 不使用连接池
|
||||
<bean id="defaultDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="${jdbc.driver}" />
|
||||
<property name="url" value="${jdbc.url}" />
|
||||
<property name="username" value="${jdbc.username}"/>
|
||||
<property name="password" value="${jdbc.password}"/>
|
||||
</bean>-->
|
||||
|
||||
</beans>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Jedis Configuration</description>
|
||||
|
||||
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
|
||||
<!-- 池中最大空闲链接数 -->
|
||||
<property name="maxIdle" value="${redis.pool.maxIdle}" />
|
||||
<!-- 池中最大链接数 -->
|
||||
<property name="maxTotal" value="${redis.pool.maxTotal}" />
|
||||
<!-- 当池中链接耗尽,调用者最大阻塞时间,超出此时间将跑出异常。(单位:毫秒;默认为-1,表示永不超时) -->
|
||||
<property name="maxWaitMillis" value="10000" />
|
||||
<!-- 是否检测空闲超时。如果超时,则会被移除 -->
|
||||
<property name="testWhileIdle" value="true" />
|
||||
<property name="testOnBorrow" value="false" />
|
||||
<property name="testOnReturn" value="false" />
|
||||
</bean>
|
||||
|
||||
<bean id="jedisPool" class="redis.clients.jedis.JedisPool">
|
||||
<constructor-arg index="0" ref="jedisPoolConfig" />
|
||||
<constructor-arg index="1" value="${redis.host}" />
|
||||
<constructor-arg index="2" value="${redis.port}" type="int" />
|
||||
<constructor-arg index="3" value="${redis.timeout}" type="int" />
|
||||
<constructor-arg index="4" value="${redis.password}"/>
|
||||
<constructor-arg index="5" value="${redis.database}" type="int" />
|
||||
<constructor-arg index="6" value="${redis.keyPrefix}"/>
|
||||
<constructor-arg index="7" value="${redis.isSSL}" type="boolean"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Spring EhCache Configuration</description>
|
||||
|
||||
<!-- 自定义Session存储容器 -->
|
||||
<bean id="sessionDAO" class="com.jeesite.common.shiro.session.CacheSessionDAO">
|
||||
<property name="sessionIdGenerator" ref="idGen" />
|
||||
<property name="activeSessionsCacheName" value="activeSessionsCache" />
|
||||
<property name="cacheManager" ref="shiroCacheManager"/>
|
||||
</bean>
|
||||
|
||||
<!-- 自定义系统缓存管理器-->
|
||||
<bean id="shiroCacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
|
||||
<property name="cacheManager" ref="ehCacheManager"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Spring Redis Configuration</description>
|
||||
|
||||
<!-- 自定义Session存储容器 -->
|
||||
<bean id="sessionDAO" class="com.jeesite.common.shiro.session.JedisSessionDAO">
|
||||
<property name="sessionIdGenerator" ref="idGen" />
|
||||
<property name="sessionKeyPrefix" value="${redis.keyPrefix}_session_" />
|
||||
</bean>
|
||||
|
||||
<!-- 自定义系统缓存管理器-->
|
||||
<bean id="shiroCacheManager" class="com.jeesite.common.shiro.cache.JedisCacheManager">
|
||||
<property name="cacheKeyPrefix" value="${redis.keyPrefix}_cache_" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,121 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Shiro Configuration</description>
|
||||
|
||||
<!-- Shiro权限过滤过滤器定义 -->
|
||||
<bean id="shiroFilterChainDefinitionMap" class="com.jeesite.common.shiro.config.FilterChainDefinitionMap">
|
||||
|
||||
<!-- 默认的授权过滤定义,如果在filterChainDefinitions中已经定义,则该定义会被覆盖。-->
|
||||
<property name="defaultFilterChainDefinitions" value="${shiro.defaultFilterChainDefinitions}"/>
|
||||
|
||||
<!-- 自定义的授权过滤器 -->
|
||||
<property name="filterChainDefinitions" value="${shiro.filterChainDefinitions}"/>
|
||||
|
||||
</bean>
|
||||
|
||||
<!-- Shiro安全认证过滤器 -->
|
||||
<bean id="shiroFilter" class="com.jeesite.common.shiro.web.ShiroFilterFactoryBean">
|
||||
<property name="securityManager" ref="securityManager" />
|
||||
<property name="loginUrl" value="${shiro.loginUrl}" />
|
||||
<property name="successUrl" value="${shiro.successUrl}" />
|
||||
<property name="filters">
|
||||
<map>
|
||||
<entry key="cas" value-ref="shiroCasFilter" />
|
||||
<entry key="authc" value-ref="shiroAuthcFilter" />
|
||||
<entry key="logout" value-ref="shiroLogoutFilter"/>
|
||||
<entry key="perms" value-ref="shiroPermsFilter"/>
|
||||
<entry key="roles" value-ref="shiroRolesFilter"/>
|
||||
<entry key="user" value-ref="shiroUserFilter"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="filterChainDefinitionMap" ref="shiroFilterChainDefinitionMap"/>
|
||||
</bean>
|
||||
|
||||
<!-- CAS登录过滤器 -->
|
||||
<bean id="shiroCasFilter" class="com.jeesite.common.shiro.filter.CasAuthenticationFilter">
|
||||
<property name="authorizingRealm" ref="authorizingRealm"/>
|
||||
</bean>
|
||||
|
||||
<!-- Form登录过滤器 -->
|
||||
<bean id="shiroAuthcFilter" class="com.jeesite.common.shiro.filter.FormAuthenticationFilter">
|
||||
<property name="authorizingRealm" ref="authorizingRealm"/>
|
||||
</bean>
|
||||
|
||||
<!-- 登出过滤器 -->
|
||||
<bean id="shiroLogoutFilter" class="com.jeesite.common.shiro.filter.LogoutFilter"/>
|
||||
|
||||
<!-- 权限字符串过滤器 -->
|
||||
<bean id="shiroPermsFilter" class="com.jeesite.common.shiro.filter.PermissionsAuthorizationFilter"/>
|
||||
|
||||
<!-- 角色权限过滤器 -->
|
||||
<bean id="shiroRolesFilter" class="com.jeesite.common.shiro.filter.RolesAuthorizationFilter"/>
|
||||
|
||||
<!-- 用户权限过滤器 -->
|
||||
<bean id="shiroUserFilter" class="com.jeesite.common.shiro.filter.UserFilter"/>
|
||||
|
||||
<!-- 单点登录信息句柄,单点退出用 -->
|
||||
<bean id="casOutHandler" class="com.jeesite.common.shiro.cas.CasOutHandler"/>
|
||||
|
||||
<!-- 系统安全认证实现类 -->
|
||||
<bean id="authorizingRealm" class="com.jeesite.common.shiro.realm.AuthorizingRealm">
|
||||
<property name="cachingEnabled" value="false"/>
|
||||
<property name="sessionDAO" ref="sessionDAO"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="empUserService" ref="empUserService"/>
|
||||
<property name="casOutHandler" ref="casOutHandler"/>
|
||||
<property name="casServerUrl" value="${shiro.casServerUrl}"/>
|
||||
<property name="casServerCallbackUrl" value="${shiro.casClientUrl}${adminPath}/login-cas"/>
|
||||
</bean>
|
||||
|
||||
<!-- 定义Shiro安全管理配置 -->
|
||||
<bean id="securityManager" class="com.jeesite.common.shiro.web.WebSecurityManager">
|
||||
<property name="realm" ref="authorizingRealm" />
|
||||
<property name="sessionManager" ref="sessionManager" />
|
||||
<!-- shiroCacheManager 在spring-context.xml中定义 -->
|
||||
<property name="cacheManager" ref="shiroCacheManager" />
|
||||
<!-- 设置支持CAS的subjectFactory -->
|
||||
<property name="subjectFactory">
|
||||
<bean class="org.apache.shiro.cas.CasSubjectFactory"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 自定义会话管理配置 -->
|
||||
<bean id="sessionManager" class="com.jeesite.common.shiro.session.SessionManager">
|
||||
<!-- sessionDAO 在spring-context.xml中定义 -->
|
||||
<property name="sessionDAO" ref="sessionDAO"/>
|
||||
|
||||
<!-- 从URL中去掉JSESSIONID串 -->
|
||||
<property name="sessionIdUrlRewritingEnabled" value="false" />
|
||||
|
||||
<!-- 会话超时时间,单位:毫秒 -->
|
||||
<property name="globalSessionTimeout" value="${session.sessionTimeout}"/>
|
||||
|
||||
<!-- 定时清理失效会话, 清理用户直接关闭浏览器造成的孤立会话 -->
|
||||
<property name="sessionValidationInterval" value="${session.sessionTimeoutClean}"/>
|
||||
<property name="sessionValidationSchedulerEnabled" value="true"/>
|
||||
|
||||
<property name="sessionIdCookie" ref="sessionIdCookie"/>
|
||||
<property name="sessionIdCookieEnabled" value="true"/>
|
||||
</bean>
|
||||
|
||||
<!-- 指定本系统SESSIONID, 默认为: JSESSIONID 问题: 与SERVLET容器名冲突, 如JETTY, TOMCAT 等默认JSESSIONID,
|
||||
当跳出SHIRO SERVLET时如ERROR-PAGE容器会为JSESSIONID重新分配值导致登录会话丢失! -->
|
||||
<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
|
||||
<constructor-arg name="name" value="${session.sessionIdCookieName}"/>
|
||||
</bean>
|
||||
|
||||
<!-- 支持Shiro对Controller的方法级AOP安全控制 -->
|
||||
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
|
||||
<property name="securityManager" ref="securityManager"/>
|
||||
</bean>
|
||||
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
|
||||
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
|
||||
<property name="proxyTargetClass" value="true" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,150 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Spring Configuration Test</description>
|
||||
|
||||
<!-- 加载配置属性文件(谁先加载,谁优先级越高,jeesite.yml的优先级高于jeesite-core.yml)-->
|
||||
<bean id="yamlProperties" class="org.springframework.beans.factory.config.YamlPropertiesFactoryBean">
|
||||
<property name="resources">
|
||||
<array><value>classpath:jeesite-core.yml</value>
|
||||
<value>classpath:jeesite.yml</value></array>
|
||||
</property>
|
||||
</bean>
|
||||
<context:property-placeholder properties-ref="yamlProperties" ignore-unresolvable="true"/>
|
||||
|
||||
<!-- 使用Annotation自动注册Bean,解决事物失效问题:在主容器中不扫描@Controller注解,在SpringMvc中只扫描@Controller注解。 -->
|
||||
<context:component-scan base-package="com.jeesite"><!-- base-package 如果多个,用“,”分隔 -->
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||
</context:component-scan>
|
||||
|
||||
<!-- 扫描包设置(MyBatis Aliases、MyBatis Mappers) -->
|
||||
<bean name="scanBasePackage" class="java.lang.String">
|
||||
<constructor-arg><value>com.jeesite</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<!-- Spring Application Context Holder -->
|
||||
<bean id="springUtils" class="com.jeesite.common.utils.SpringUtils" lazy-init="false"></bean>
|
||||
|
||||
<!-- MyBatis SqlSessionFactoryBean -->
|
||||
<bean id="sqlSessionFactory" class="com.jeesite.common.mybatis.SqlSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="typeAliasesPackage" ref="scanBasePackage"/>
|
||||
<property name="typeAliasesSuperType" value="com.jeesite.common.entity.BaseEntity"/>
|
||||
<property name="mapperLocations" value="classpath*:/mappings/**/*.xml"/>
|
||||
<property name="configLocation" value="classpath:/mybatis/mybatis-config.xml"></property>
|
||||
<property name="configurationProperties"><props>
|
||||
<prop key="_prefix">${jdbc.tablePrefix}</prop>
|
||||
</props></property>
|
||||
</bean>
|
||||
|
||||
<!-- 扫描basePackage下所有以@MyBatisDao注解的接口 -->
|
||||
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
|
||||
<property name="basePackage" ref="scanBasePackage"/>
|
||||
<property name="annotationClass" value="com.jeesite.common.mybatis.annotation.MyBatisDao"/>
|
||||
</bean>
|
||||
|
||||
<!-- 定义事务 -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置 Annotation 驱动,扫描@Transactional注解的类定义事务 -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
|
||||
|
||||
<!-- 多数据源配置 -->
|
||||
<bean id="dataSource" class="com.jeesite.common.datasource.RoutingDataSource">
|
||||
<property name="targetDataSources">
|
||||
<map key-type="java.lang.String"></map>
|
||||
</property>
|
||||
<property name="defaultTargetDataSource" ref="defaultDataSource"/>
|
||||
</bean>
|
||||
|
||||
<!-- 默认数据源配置, 使用 Druid 数据库连接池 -->
|
||||
<bean id="defaultDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
|
||||
<!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
|
||||
<property name="driverClassName" value="${jdbc.driver}" />
|
||||
|
||||
<!-- 基本属性 url、user、password -->
|
||||
<property name="url" value="${jdbc.url}" />
|
||||
<property name="username" value="${jdbc.username}" />
|
||||
<property name="password" value="${jdbc.password}" />
|
||||
|
||||
<!-- 配置初始化大小、最小、最大 -->
|
||||
<property name="initialSize" value="${jdbc.pool.init}" />
|
||||
<property name="minIdle" value="${jdbc.pool.minIdle}" />
|
||||
<property name="maxActive" value="${jdbc.pool.maxActive}" />
|
||||
|
||||
<!-- 配置获取连接等待超时的时间 -->
|
||||
<property name="maxWait" value="60000" />
|
||||
|
||||
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
|
||||
<property name="timeBetweenEvictionRunsMillis" value="60000" />
|
||||
|
||||
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
|
||||
<property name="minEvictableIdleTimeMillis" value="300000" />
|
||||
|
||||
<!-- 泄露的连接可以被删除的超时值,单位秒
|
||||
<property name="removeAbandoned" value="true" />
|
||||
<property name="removeAbandonedTimeout" value="1800" />-->
|
||||
|
||||
<!-- <property name="validationQuery" value="${jdbc.testSql}" /> -->
|
||||
<property name="testWhileIdle" value="false" />
|
||||
<property name="testOnBorrow" value="false" />
|
||||
<property name="testOnReturn" value="false" />
|
||||
|
||||
<!-- 打开PSCache,并且指定每个连接上PSCache的大小(Oracle使用)
|
||||
<property name="poolPreparedStatements" value="true" />
|
||||
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> -->
|
||||
|
||||
<!-- 配置监控统计拦截的filters -->
|
||||
<property name="filters" value="stat" />
|
||||
|
||||
<!-- 配置自定义的拦截器 -->
|
||||
<property name="proxyFilters">
|
||||
<list>
|
||||
<bean class="com.jeesite.common.datasource.filter.ConfigFilter" />
|
||||
</list>
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
<!-- 数据库自动升级程序 -->
|
||||
<bean id="dbUpgrade" class="com.jeesite.common.db.DbUpgrade"></bean>
|
||||
|
||||
<!-- 配置国际化资源文件路径 -->
|
||||
<bean id="messageSource" class="com.jeesite.common.i18n.I18nMessageSource"
|
||||
depends-on="springUtils">
|
||||
</bean>
|
||||
|
||||
<!-- 基于Cookie和Session的本地化解析器 -->
|
||||
<bean id="localeResolver" class="com.jeesite.common.i18n.I18nLocaleResolver">
|
||||
<property name="defaultLocale" value="zh_CN" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置 JSR303 Bean Validator 定义 -->
|
||||
<bean id="beanValidator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
|
||||
<property name="providerClass" value="org.hibernate.validator.HibernateValidator"/>
|
||||
</bean>
|
||||
|
||||
<!-- 缓存配置 -->
|
||||
<bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
|
||||
<!-- <property name="configLocation" value="classpath:${ehcache.configFile}" /> -->
|
||||
</bean>
|
||||
|
||||
<!-- 自定义系统缓存管理器-->
|
||||
<bean id="shiroCacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
|
||||
<property name="cacheManager" ref="ehCacheManager"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<description>Spring MVC Configuration</description>
|
||||
|
||||
<!-- 加载配置属性文件(谁先加载,谁优先级越高,jeesite.yml的优先级高于jeesite-core.yml)-->
|
||||
<bean id="yamlProperties" class="org.springframework.beans.factory.config.YamlPropertiesFactoryBean">
|
||||
<property name="resources">
|
||||
<array><value>classpath:jeesite-core.yml</value>
|
||||
<value>classpath:jeesite.yml</value></array>
|
||||
</property>
|
||||
</bean>
|
||||
<context:property-placeholder properties-ref="yamlProperties" ignore-unresolvable="true"/>
|
||||
|
||||
<!-- 默认的注解映射的支持,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping -->
|
||||
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" validator="beanValidator">
|
||||
<mvc:message-converters register-defaults="true">
|
||||
<!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->
|
||||
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
|
||||
<constructor-arg value="UTF-8" />
|
||||
</bean>
|
||||
<!-- 将Jackson2HttpMessageConverter的默认格式化输出为false -->
|
||||
<bean class="com.jeesite.common.web.converter.JsonHttpMessageConverter">
|
||||
<property name="prettyPrint" value="false"/>
|
||||
</bean>
|
||||
<!-- 将Jackson2XmlHttpMessageConverter的默认格式化输出为false -->
|
||||
<bean class="com.jeesite.common.web.converter.XmlHttpMessageConverter">
|
||||
<property name="prettyPrint" value="false"/>
|
||||
</bean>
|
||||
</mvc:message-converters>
|
||||
</mvc:annotation-driven>
|
||||
|
||||
<!-- REST中根据MediaType自动判定Content-Type及相应的View -->
|
||||
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
||||
<property name="mediaTypes" >
|
||||
<value>
|
||||
json=application/json
|
||||
xml=application/xml
|
||||
</value>
|
||||
</property>
|
||||
<property name="ignoreAcceptHeader" value="true"/><!-- 忽略accept-header匹配,不加后缀使用默认配置 -->
|
||||
<property name="favorPathExtension" value="true"/><!-- .json、.xml后缀匹配 -->
|
||||
<property name="favorParameter" value="false"/><!-- format参数名匹配 -->
|
||||
</bean>
|
||||
|
||||
<!-- 定义视图文件解析 -->
|
||||
<mvc:view-resolvers>
|
||||
<!-- Beetl主题视图解析器(order越小优先级越高) -->
|
||||
<bean name="viewResolverBeetlThemes" class="com.jeesite.common.beetl.view.BeetlViewResolver">
|
||||
<property name="prefix" value="/themes/${web.view.themeName}/"/>
|
||||
<property name="suffix" value=".html" />
|
||||
<property name="order" value="1000" />
|
||||
</bean>
|
||||
<!-- Beetl默认视图文件解析(order越小优先级越高) -->
|
||||
<bean name="viewResolverBeetlDefault" class="com.jeesite.common.beetl.view.BeetlViewResolver">
|
||||
<property name="prefix" value="/"/>
|
||||
<property name="suffix" value=".html" />
|
||||
<property name="order" value="2000" />
|
||||
</bean>
|
||||
<!-- JSP主题视图文件解析(order越小优先级越高) -->
|
||||
<bean id="viewResolverJspThemes" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="viewClass" value="com.jeesite.common.web.view.JstlView" />
|
||||
<property name="prefix" value="/WEB-INF/views/themes/${web.view.themeName}/"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
<property name="order" value="10000"/>
|
||||
</bean>
|
||||
<!-- JSP视图文件解析 (order越小优先级越高)-->
|
||||
<bean id="viewResolverJspDefault" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="viewClass" value="com.jeesite.common.web.view.JstlView" />
|
||||
<property name="prefix" value="/WEB-INF/views/"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
<property name="order" value="20000"/>
|
||||
</bean>
|
||||
<!-- 默认视图定义,根据后缀渲染 -->
|
||||
<mvc:content-negotiation>
|
||||
<mvc:default-views>
|
||||
<bean class="com.jeesite.common.web.view.JsonView">
|
||||
<property name="prettyPrint" value="false"/>
|
||||
</bean>
|
||||
<bean class="com.jeesite.common.web.view.XmlView">
|
||||
<property name="prettyPrint" value="false"/>
|
||||
</bean>
|
||||
</mvc:default-views>
|
||||
</mvc:content-negotiation>
|
||||
</mvc:view-resolvers>
|
||||
|
||||
<!-- 静态资源映射,可读取classes下、jar包里的静态文件 -->
|
||||
<mvc:resources mapping="/static/**" location="/static/,classpath:/static/" cache-period="31536000"/>
|
||||
|
||||
<!-- 对静态资源文件的访问, 将无法mapping到Controller的path交给default servlet handler处理 -->
|
||||
<mvc:default-servlet-handler/>
|
||||
|
||||
<!-- 异常拦截,处理异常信息,其它异常拦截见BaseController里的@ExceptionHandler注解 -->
|
||||
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
|
||||
<property name="exceptionMappings">
|
||||
<props>
|
||||
<prop key="org.apache.shiro.authz.UnauthenticatedException">error/403</prop>
|
||||
<prop key="org.apache.shiro.authz.UnauthorizedException">error/403</prop>
|
||||
<prop key="java.lang.Throwable">error/500</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Spring MVC上传文件 MultipartFile 拦截,设置字符集 -->
|
||||
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<property name="defaultEncoding" value="UTF-8" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<description>Spring MVC Log Interceptor Configuration</description>
|
||||
|
||||
<!-- SpringMVC拦截器配置,拦截顺序:先执行后定义的,排在第一位的最后执行。-->
|
||||
<mvc:interceptors>
|
||||
<!-- 日志记录拦截器 -->
|
||||
<mvc:interceptor>
|
||||
<mvc:mapping path="${adminPath}/**" />
|
||||
<mvc:exclude-mapping path="${adminPath}"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/index"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/login"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/sys/log/**"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/**/listData"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/**/treeData"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/sys/menu/tree"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/sys/online/count"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/file/ueditor/config"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/file/fileList"/>
|
||||
<mvc:exclude-mapping path="${adminPath}/tag/treeselect"/>
|
||||
<bean class="com.jeesite.modules.sys.interceptor.LogInterceptor" />
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptors>
|
||||
|
||||
</beans>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<description>Spring MVC Log Interceptor Configuration</description>
|
||||
|
||||
<!-- SpringMVC拦截器配置,拦截顺序:先执行后定义的,排在第一位的最后执行。-->
|
||||
<mvc:interceptors>
|
||||
<!-- 手机视图拦截器 -->
|
||||
<mvc:interceptor>
|
||||
<mvc:mapping path="${frontPath}/**" />
|
||||
<bean class="com.jeesite.modules.sys.interceptor.MobileInterceptor" />
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptors>
|
||||
|
||||
</beans>
|
||||
@@ -20,6 +20,7 @@ echo.
|
||||
pause
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ../
|
||||
@@ -5,7 +5,7 @@ rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>war<61><72><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>war/jar<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
||||
echo.
|
||||
pause
|
||||
echo.
|
||||
@@ -14,6 +14,6 @@ echo.
|
||||
cd %~dp0
|
||||
|
||||
cd ../
|
||||
call mvn clean package -Dmaven.test.skip=true -Ppackage -U
|
||||
call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||
|
||||
pause
|
||||
@@ -1,34 +0,0 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
title %cd%
|
||||
echo.
|
||||
echo [<5B><>Ϣ] ʹ<><CAB9>Jetty<74><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̡<EFBFBD>
|
||||
echo.
|
||||
rem pause
|
||||
rem echo.
|
||||
|
||||
cd %~dp0
|
||||
cd ..
|
||||
set currPath=%cd%
|
||||
|
||||
set MAVEN_OPTS=%MAVEN_OPTS% -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m
|
||||
|
||||
if exist "../parent/pom.xml" (
|
||||
cd ../parent
|
||||
call mvn clean install -Dmaven.test.skip=true
|
||||
)
|
||||
|
||||
if exist "../modules/pom.xml" (
|
||||
cd ../modules
|
||||
call mvn clean install -Dmaven.test.skip=true
|
||||
)
|
||||
|
||||
cd %currPath%
|
||||
call mvn jetty:run -D maven.javadoc.skip=true -U
|
||||
|
||||
cd bin
|
||||
pause
|
||||
32
web/bin/run-tomcat.bat
Normal file
32
web/bin/run-tomcat.bat
Normal file
@@ -0,0 +1,32 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] ʹ<><CAB9> Spring Boot Tomcat <20><><EFBFBD><EFBFBD> Web <20><><EFBFBD>̡<EFBFBD>
|
||||
echo.
|
||||
rem pause
|
||||
rem echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ../
|
||||
title %cd%
|
||||
|
||||
set currPath=%cd%
|
||||
|
||||
set MAVEN_OPTS=%MAVEN_OPTS% -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m
|
||||
|
||||
if exist "../package/pom.xml" (
|
||||
cd ../package
|
||||
call mvn clean install -Dmaven.test.skip=true -Ppackage -U
|
||||
)
|
||||
|
||||
cd %currPath%
|
||||
|
||||
call mvn clean spring-boot:run -U
|
||||
|
||||
pause
|
||||
13
web/bin/run-tomcat.sh
Normal file
13
web/bin/run-tomcat.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# */
|
||||
|
||||
cd ../
|
||||
|
||||
MAVEN_OPTS=$MAVEN_OPTS -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m
|
||||
|
||||
exec mvn clean spring-boot:run -U
|
||||
23
web/bin/startup.bat
Normal file
23
web/bin/startup.bat
Normal file
@@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD> Web <20><><EFBFBD>̡<EFBFBD>
|
||||
echo.
|
||||
rem pause
|
||||
rem echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ../
|
||||
title %cd%
|
||||
|
||||
set JAVA_OPTS= -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m
|
||||
|
||||
java -jar target/jeesite-web-4.0-SNAPSHOT.war
|
||||
|
||||
pause
|
||||
399
web/pom.xml
399
web/pom.xml
@@ -1,219 +1,180 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-web</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>JeeSite Web</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
<spring-boot.version>1.5.9.RELEASE</spring-boot.version>
|
||||
|
||||
<!-- environment setting -->
|
||||
<tomcat.version>2.2</tomcat.version>
|
||||
<jetty.version>8.1.0.RC5</jetty.version>
|
||||
<webserver.port>8080</webserver.port>
|
||||
<downloadSources>false</downloadSources>
|
||||
<downloadJavadocs>false</downloadJavadocs>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-devtools</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 内容管理模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-cms</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- FoxBPM流程引擎模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-foxbpm</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 微信模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-weixin</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 静态资源-ACE主题
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-themes-ace</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 自定义jar依赖包演示
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>test-core</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/test-core-1.0.jar</systemPath>
|
||||
</dependency> -->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
|
||||
<plugins>
|
||||
|
||||
<!-- WAR打包插件, 设定war包名称不带版本号 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<packagingExcludes>
|
||||
</packagingExcludes>
|
||||
<warSourceExcludes>
|
||||
userfiles/**,
|
||||
test/**
|
||||
</warSourceExcludes>
|
||||
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
|
||||
<warName>${project.artifactId}</warName>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
</archive>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Eclipse插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<configuration>
|
||||
<downloadSources>${downloadSources}</downloadSources>
|
||||
<downloadJavadocs>${downloadJavadocs}</downloadJavadocs>
|
||||
<wtpContextName>${project.artifactId}</wtpContextName>
|
||||
<wtpversion>2.0</wtpversion>
|
||||
<jeeversion>6.0</jeeversion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Tomcat7插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.tomcat.maven</groupId>
|
||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||
<version>${tomcat.version}</version>
|
||||
<configuration>
|
||||
<port>${webserver.port}</port>
|
||||
<path>/${project.artifactId}</path>
|
||||
<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Jetty插件 -->
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>${jetty.version}</version>
|
||||
<configuration>
|
||||
<connectors>
|
||||
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
|
||||
<port>${webserver.port}</port>
|
||||
</connector>
|
||||
</connectors>
|
||||
<webAppConfig>
|
||||
<contextPath>/${project.artifactId}</contextPath>
|
||||
</webAppConfig>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>org.mortbay.util.URI.charset</name>
|
||||
<value>${project.build.sourceEncoding}</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
<repositories>
|
||||
|
||||
<repository>
|
||||
<id>aliyun-repos</id>
|
||||
<name>Aliyun Repository</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-repos</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/groups/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-repos-s</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases><enabled>false</enabled></releases>
|
||||
<snapshots><enabled>true</enabled></snapshots>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
|
||||
<pluginRepository>
|
||||
<id>aliyun-repos</id>
|
||||
<name>Aliyun Repository</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>sonatype-repos</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-web</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>JeeSite Boot</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
<start-class>com.jeesite.config.Application</start-class>
|
||||
<eclipse-plugin-download-sources>false</eclipse-plugin-download-sources>
|
||||
<eclipse-plugin-download-javadocs>false</eclipse-plugin-download-javadocs>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-devtools</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 内容管理模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-cms</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 微信模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-weixin</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 自定义jar依赖包演示
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>test-core</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/test-core-1.0.jar</systemPath>
|
||||
</dependency> -->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- WAR打包插件, 设定war包名称不带版本号 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<packagingExcludes>
|
||||
</packagingExcludes>
|
||||
<warSourceExcludes>
|
||||
userfiles/**,
|
||||
test/**
|
||||
</warSourceExcludes>
|
||||
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
|
||||
<warName>${project.artifactId}</warName>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
</archive>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Eclipse插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<configuration>
|
||||
<downloadSources>${eclipse-plugin-download-sources}</downloadSources>
|
||||
<downloadJavadocs>${eclipse-plugin-download-javadocs}</downloadJavadocs>
|
||||
<wtpContextName>${project.artifactId}</wtpContextName>
|
||||
<wtpversion>2.0</wtpversion>
|
||||
<jeeversion>6.0</jeeversion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
<repositories>
|
||||
|
||||
<repository>
|
||||
<id>aliyun-repos</id>
|
||||
<name>Aliyun Repository</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-repos</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/groups/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-repos-s</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases><enabled>false</enabled></releases>
|
||||
<snapshots><enabled>true</enabled></snapshots>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
|
||||
<pluginRepository>
|
||||
<id>aliyun-repos</id>
|
||||
<name>Aliyun Repository</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>sonatype-repos</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
|
||||
33
web/src/main/java/com/jeesite/config/Application.java
Normal file
33
web/src/main/java/com/jeesite/config/Application.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
||||
|
||||
import com.jeesite.common.io.PropertiesUtils;
|
||||
|
||||
/**
|
||||
* JeeSite Web
|
||||
* @author ThinkGem
|
||||
* @version 2018-1-8
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages={"com.jeesite.config"})
|
||||
public class Application extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication app = new SpringApplication(Application.class);
|
||||
app.setDefaultProperties(PropertiesUtils.getInstance().getProperties());
|
||||
app.run(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
builder.properties(PropertiesUtils.getInstance().getProperties());
|
||||
return builder.sources(Application.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.task;
|
||||
|
||||
/**
|
||||
* 消息发送服务,如果需要支持定时任务,则要在作业管理里添加该任务:msgLocalSendTask.execute();
|
||||
* @author ThinkGem
|
||||
* @version 2018年1月10日
|
||||
*/
|
||||
public class MsgLocalSendTask {
|
||||
|
||||
// <bean id="msgLocalSendTask" class="com.jeesite.modules.msg.task.MsgLocalSendTask">
|
||||
// <property name="messageService" ref="messageService" />
|
||||
// <property name="smsSendService">
|
||||
// <bean class="com.jeesite.modules.msg.task.impl.SmsDemoSendService"></bean>
|
||||
// </property>
|
||||
// <property name="mailSendService">
|
||||
// <bean class="com.jeesite.modules.msg.task.impl.EmailSendService"></bean>
|
||||
// </property>
|
||||
// <property name="weixinSendService">
|
||||
// <bean class="com.jeesite.modules.msg.task.impl.WeixinSendService">
|
||||
// <property name="weixinService" ref="weixinService"></property>
|
||||
// </bean>
|
||||
// </property>
|
||||
// </bean>-->
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.web;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import com.alibaba.druid.support.http.WebStatFilter;
|
||||
|
||||
/**
|
||||
* Servlet 配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidStatConfig {
|
||||
|
||||
/**
|
||||
* 注册DruidFilter拦截
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean duridFilter() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter(new WebStatFilter());
|
||||
bean.addInitParameter("exclusions", "*.css,*.js,*.png,"
|
||||
+ "*.jpg,*.gif,*.jpeg,*.bmp,*.ico,*.swf,*.psd,*.htc,*.htm,*.html,"
|
||||
+ "*.crx,*.xpi,*.exe,*.ipa,*.apk,*.otf,*.eot,*.svg,*.ttf,*.woff,"
|
||||
+ "/druid/*");
|
||||
bean.addUrlPatterns("/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册DruidServlet
|
||||
*/
|
||||
@Bean
|
||||
public ServletRegistrationBean druidServlet() {
|
||||
ServletRegistrationBean bean = new ServletRegistrationBean();
|
||||
bean.setServlet(new StatViewServlet());
|
||||
bean.addUrlMappings("/druid/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
83
web/src/main/java/com/jeesite/config/web/FilterConfig.java
Normal file
83
web/src/main/java/com/jeesite/config/web/FilterConfig.java
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.web;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.filter.CharacterEncodingFilter;
|
||||
import org.springframework.web.filter.DelegatingFilterProxy;
|
||||
import org.springframework.web.filter.RequestContextFilter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.web.PageCachingFilter;
|
||||
|
||||
/**
|
||||
* Filter 配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@Configuration
|
||||
public class FilterConfig {
|
||||
|
||||
/**
|
||||
* Encoding Filter
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean characterEncodingFilter() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter(new CharacterEncodingFilter());
|
||||
bean.addInitParameter("encoding", "UTF-8");
|
||||
bean.addInitParameter("forceEncoding", "true");
|
||||
bean.addUrlPatterns("/*");
|
||||
bean.setOrder(1000);
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* PageCache Filter, cache .html suffix.
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "ehcache.pageCaching.enabled", havingValue = "true")
|
||||
public FilterRegistrationBean pageCachingFilter(EhCacheManagerFactoryBean ehCacheManager) {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
PageCachingFilter pageCachingFilter = new PageCachingFilter();
|
||||
pageCachingFilter.setCacheManager(ehCacheManager.getObject());
|
||||
bean.setFilter(pageCachingFilter);
|
||||
bean.addInitParameter("cacheName", "pageCachingFilter");
|
||||
bean.addUrlPatterns(StringUtils.split(Global.getProperty(
|
||||
"ehcache.pageCaching.urlPatterns"), ","));
|
||||
bean.setOrder(2000);
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apache Shiro Filter
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean shiroFilterProxy() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter(new DelegatingFilterProxy("shiroFilter"));
|
||||
bean.addInitParameter("targetFilterLifecycle", "true");
|
||||
bean.addUrlPatterns("/*");
|
||||
bean.setOrder(3000);
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request Context Filter 需要放在shiroFilter后,否则request获取不到session
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean requestContextFilter() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter(new RequestContextFilter());
|
||||
bean.addUrlPatterns("/*");
|
||||
bean.setOrder(4000);
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
43
web/src/main/java/com/jeesite/config/web/ListenerConfig.java
Normal file
43
web/src/main/java/com/jeesite/config/web/ListenerConfig.java
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.web;
|
||||
|
||||
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.context.request.RequestContextListener;
|
||||
|
||||
import com.jeesite.common.shiro.cas.CasOutSessionListener;
|
||||
|
||||
/**
|
||||
* Listener 配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月29日
|
||||
*/
|
||||
@Configuration
|
||||
public class ListenerConfig {
|
||||
|
||||
/**
|
||||
* CAS Session Listener
|
||||
*/
|
||||
@Bean
|
||||
public ServletListenerRegistrationBean<CasOutSessionListener> casOutSessionListener() {
|
||||
ServletListenerRegistrationBean<CasOutSessionListener> bean = new ServletListenerRegistrationBean<>();
|
||||
bean.setListener(new CasOutSessionListener());
|
||||
bean.setOrder(1000);
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request Context Listener
|
||||
*/
|
||||
@Bean
|
||||
public ServletListenerRegistrationBean<RequestContextListener> requestContextListener() {
|
||||
ServletListenerRegistrationBean<RequestContextListener> bean = new ServletListenerRegistrationBean<>();
|
||||
bean.setListener(new RequestContextListener());
|
||||
bean.setOrder(2000);
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
16
web/src/main/java/com/jeesite/config/web/ServletConfig.java
Normal file
16
web/src/main/java/com/jeesite/config/web/ServletConfig.java
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.web;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Servlet 配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@Configuration
|
||||
public class ServletConfig {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.web.interceptor;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.sys.interceptor.LogInterceptor;
|
||||
|
||||
/**
|
||||
* 后台管理日志记录拦截器
|
||||
* @author ThinkGem
|
||||
* @version 2018年1月10日
|
||||
*/
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ConditionalOnProperty(name="web.interceptor.log.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class LogInterceptorConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new LogInterceptor())
|
||||
.addPathPatterns(Global.getAdminPath() + "/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/index")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/login")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/**/listData")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/**/treeData")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/file/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/tags/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/sys/log/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/sys/online/count")
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.config.web.interceptor;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.sys.interceptor.LogInterceptor;
|
||||
|
||||
/**
|
||||
* 前台自动切换到手机视图拦截器
|
||||
* @author ThinkGem
|
||||
* @version 2018年1月10日
|
||||
*/
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ConditionalOnProperty(name="web.interceptor.mobile.enabled", havingValue="true")
|
||||
public class MobileViewInterceptorConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new LogInterceptor())
|
||||
.addPathPatterns(Global.getFrontPath() + "/**")
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
15
web/src/main/resources/application.yml
Normal file
15
web/src/main/resources/application.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
server:
|
||||
|
||||
port: 8980
|
||||
context-path: /js
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
|
||||
spring:
|
||||
main:
|
||||
banner-mode: "off"
|
||||
|
||||
debug: true
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#设置与beetl-default.properties相同的属性将被覆盖默认设置
|
||||
|
||||
##导入项目中的调用静态方法类(项目中设置,自动合并IMPORT_PACKAGE设置)
|
||||
#IMPORT_PACKAGE_你的模块编码=\
|
||||
#IMPORT_PACKAGE_PROJECT=\
|
||||
# com.jeesite.modules.project.utils.;\
|
||||
|
||||
## 内置的方法
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
|
||||
#============================#
|
||||
#===== Database sttings =====#
|
||||
#============================#
|
||||
|
||||
# 数据库连接
|
||||
jdbc:
|
||||
|
||||
# Oracle 数据库配置
|
||||
type: oracle
|
||||
driver: oracle.jdbc.driver.OracleDriver
|
||||
url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||
username: jeesite
|
||||
password: jeesite
|
||||
testSql: SELECT 1 FROM DUAL
|
||||
|
||||
# Mysql 数据库配置
|
||||
# type: mysql
|
||||
# driver: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://127.0.0.1:3306/jeesite?useUnicode=true&characterEncoding=utf-8
|
||||
# username: jeesite
|
||||
# password: jeesite
|
||||
# testSql: SELECT 1
|
||||
|
||||
#============================#
|
||||
#===== System settings ======#
|
||||
#============================#
|
||||
|
||||
#产品信息设置
|
||||
productName: JeeSite Demo
|
||||
productVersion: V4.0
|
||||
copyrightYear: 2018
|
||||
companyName: ThinkGem
|
||||
|
||||
#是否演示模式
|
||||
demoMode: false
|
||||
|
||||
#============================#
|
||||
#===== Database sttings =====#
|
||||
#============================#
|
||||
|
||||
# 数据库连接
|
||||
jdbc:
|
||||
|
||||
# Oracle 数据库配置
|
||||
type: oracle
|
||||
driver: oracle.jdbc.driver.OracleDriver
|
||||
url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||
username: jeesite
|
||||
password: jeesite
|
||||
testSql: SELECT 1 FROM DUAL
|
||||
|
||||
# Mysql 数据库配置
|
||||
# type: mysql
|
||||
# driver: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://127.0.0.1:3306/jeesite?useUnicode=true&characterEncoding=utf-8
|
||||
# username: jeesite
|
||||
# password: jeesite
|
||||
# testSql: SELECT 1
|
||||
|
||||
#============================#
|
||||
#===== System settings ======#
|
||||
#============================#
|
||||
|
||||
#产品信息设置
|
||||
productName: JeeSite Demo
|
||||
productVersion: V4.0
|
||||
copyrightYear: 2018
|
||||
companyName: ThinkGem
|
||||
|
||||
#是否演示模式
|
||||
demoMode: false
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
<!-- Log file path ../../../../../../../ to disk root -->
|
||||
<property name="log.path" value="${logPath:-../../../../../../../}/logs" />
|
||||
|
||||
<!-- Spring boot default -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Message Task Configuration</description>
|
||||
|
||||
<!-- 本地消息发送服务,如果需要支持定时任务,则要在作业管理里添加该任务 msgLocalSendTask.execute();
|
||||
<bean id="msgLocalSendTask" class="com.jeesite.modules.msg.task.MsgLocalSendTask">
|
||||
<property name="messageService" ref="messageService" />
|
||||
<property name="smsSendService">
|
||||
<bean class="com.jeesite.modules.msg.task.impl.SmsDemoSendService"></bean>
|
||||
</property>
|
||||
<property name="mailSendService">
|
||||
<bean class="com.jeesite.modules.msg.task.impl.EmailSendService"></bean>
|
||||
</property>
|
||||
<property name="weixinSendService">
|
||||
<bean class="com.jeesite.modules.msg.task.impl.WeixinSendService">
|
||||
<property name="weixinService" ref="weixinService"></property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>-->
|
||||
|
||||
</beans>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<description>Spring Configuration</description>
|
||||
|
||||
<!-- 使用Annotation自动注册Bean,不扫描@Controller注解,如果多个,用“,”分隔 -->
|
||||
<context:component-scan base-package="com.jeesite.modules">
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice"/>
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.RestController"/>
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.RestControllerAdvice"/>
|
||||
</context:component-scan>
|
||||
|
||||
<!-- MyBatis扫描基础包设置(Aliases、@MyBatisDao),如果多个,用“,”分隔-->
|
||||
<bean name="mybatisScanBasePackage" class="java.lang.String">
|
||||
<constructor-arg><value>com.jeesite.modules</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<!-- 导入模板相关配置 -->
|
||||
<import resource="classpath*:/spring/spring-context-core.xml"/>
|
||||
<import resource="classpath*:/spring/spring-context-data.xml"/>
|
||||
<!-- <import resource="classpath*:/spring/spring-context-data-stat.xml"/> -->
|
||||
<import resource="classpath*:/spring/spring-context-jedis.xml"/>
|
||||
<import resource="classpath*:/spring/spring-context-shiro.xml"/>
|
||||
<import resource="classpath*:/spring/spring-context-shiro-ehcache.xml"/>
|
||||
<!-- <import resource="classpath*:/spring/spring-context-shiro-redis.xml"/> -->
|
||||
<import resource="classpath*:/spring/spring-context-msg-task.xml"/>
|
||||
<!-- <import resource="classpath*:/spring/spring-context-flowable.xml" /> -->
|
||||
<!-- <import resource="classpath*:/spring/spring-context-foxbpm.xml" /> -->
|
||||
<!-- <import resource="classpath*:/spring/spring-context-weixin.xml"/> -->
|
||||
|
||||
</beans>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<description>Spring MVC Configuration</description>
|
||||
|
||||
<!-- 使用Annotation自动注册Bean,只扫描@Controller,如果多个,用“,”分隔 -->
|
||||
<context:component-scan base-package="com.jeesite.modules" use-default-filters="false">
|
||||
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||
<context:include-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice"/>
|
||||
<context:include-filter type="annotation" expression="org.springframework.web.bind.annotation.RestController"/>
|
||||
<context:include-filter type="annotation" expression="org.springframework.web.bind.annotation.RestControllerAdvice"/>
|
||||
</context:component-scan>
|
||||
|
||||
<!-- 导入模板相关配置 -->
|
||||
<import resource="classpath*:/spring/spring-mvc-core.xml"/>
|
||||
<import resource="classpath*:/spring/spring-mvc-interceptor-log.xml"/>
|
||||
<!-- <import resource="classpath*:/spring/spring-mvc-interceptor-mobile.xml"/> -->
|
||||
|
||||
</beans>
|
||||
@@ -1,94 +1,94 @@
|
||||
/* 前后端通信相关的配置,注释只允许使用多行方式,此文件修改及生效,不用重启服务 */
|
||||
{
|
||||
/* 上传图片配置项 */
|
||||
"imageActionName": "uploadimage", /* 执行上传图片的action名称 */
|
||||
"imageFieldName": "upfile", /* 提交的图片表单名称 */
|
||||
"imageMaxSize": 2048000, /* 上传大小限制,单位B */
|
||||
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */
|
||||
"imageCompressEnable": true, /* 是否压缩图片,默认是true */
|
||||
"imageCompressBorder": 800, /* 图片压缩最大宽度限制 */
|
||||
"imageInsertAlign": "none", /* 插入的图片浮动方式 */
|
||||
"imageUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"imagePathFormat": "/userfiles/ueditor/{userid}/images/{yyyy}{mm}{dd}/{filename}_${time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
|
||||
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
|
||||
/* {time} 会替换成时间戳 */
|
||||
/* {yyyy} 会替换成四位年份 */
|
||||
/* {yy} 会替换成两位年份 */
|
||||
/* {mm} 会替换成两位月份 */
|
||||
/* {dd} 会替换成两位日期 */
|
||||
/* {hh} 会替换成两位小时 */
|
||||
/* {ii} 会替换成两位分钟 */
|
||||
/* {ss} 会替换成两位秒 */
|
||||
/* 非法字符 \ : * ? " < > | */
|
||||
/* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
|
||||
|
||||
/* 涂鸦图片上传配置项 */
|
||||
"scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */
|
||||
"scrawlFieldName": "upfile", /* 提交的图片表单名称 */
|
||||
"scrawlPathFormat": "/userfiles/ueditor/{userid}/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B */
|
||||
"scrawlUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"scrawlInsertAlign": "none",
|
||||
|
||||
/* 截图工具上传 */
|
||||
"snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */
|
||||
"snapscreenPathFormat": "/userfiles/ueditor/{userid}/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"snapscreenUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */
|
||||
|
||||
/* 抓取远程图片配置 */
|
||||
"catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"],
|
||||
"catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */
|
||||
"catcherFieldName": "source", /* 提交的图片列表表单名称 */
|
||||
"catcherPathFormat": "/userfiles/ueditor/{userid}/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"catcherUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"catcherMaxSize": 2048000, /* 上传大小限制,单位B */
|
||||
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */
|
||||
|
||||
/* 上传视频配置 */
|
||||
"videoActionName": "uploadvideo", /* 执行上传视频的action名称 */
|
||||
"videoFieldName": "upfile", /* 提交的视频表单名称 */
|
||||
"videoPathFormat": "/userfiles/ueditor/{userid}/videos/{yyyy}{mm}{dd}/{filename}_${time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"videoUrlPrefix": "", /* 视频访问路径前缀 */
|
||||
"videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */
|
||||
"videoAllowFiles": [
|
||||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
|
||||
".ogg", ".ogv", ".mov", ".wmv", ".mp4",".m4v", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */
|
||||
|
||||
/* 上传文件配置 */
|
||||
"fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */
|
||||
"fileFieldName": "upfile", /* 提交的文件表单名称 */
|
||||
"filePathFormat": "/userfiles/ueditor/{userid}/files/{yyyy}{mm}{dd}/{filename}_${time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"fileUrlPrefix": "", /* 文件访问路径前缀 */
|
||||
"fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */
|
||||
"fileAllowFiles": [
|
||||
".png", ".jpg", ".jpeg", ".gif", ".bmp",
|
||||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
|
||||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
|
||||
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
|
||||
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
|
||||
], /* 上传文件格式显示 */
|
||||
|
||||
/* 列出指定目录下的图片 */
|
||||
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
|
||||
"imageManagerListPath": "/userfiles/ueditor/{userid}/images/", /* 指定要列出图片的目录 */
|
||||
"imageManagerListSize": 100, /* 每次列出文件数量 */
|
||||
"imageManagerUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
|
||||
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */
|
||||
|
||||
/* 列出指定目录下的文件 */
|
||||
"fileManagerActionName": "listfile", /* 执行文件管理的action名称 */
|
||||
"fileManagerListPath": "/userfiles/ueditor/{userid}/files/", /* 指定要列出文件的目录 */
|
||||
"fileManagerListSize": 100, /* 每次列出文件数量 */
|
||||
"fileManagerUrlPrefix": "", /* 文件访问路径前缀 */
|
||||
"fileManagerAllowFiles": [
|
||||
".png", ".jpg", ".jpeg", ".gif", ".bmp",
|
||||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
|
||||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
|
||||
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
|
||||
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
|
||||
] /* 列出的文件类型 */
|
||||
|
||||
/* 前后端通信相关的配置,注释只允许使用多行方式,此文件修改及生效,不用重启服务 */
|
||||
{
|
||||
/* 上传图片配置项 */
|
||||
"imageActionName": "uploadimage", /* 执行上传图片的action名称 */
|
||||
"imageFieldName": "upfile", /* 提交的图片表单名称 */
|
||||
"imageMaxSize": 2048000, /* 上传大小限制,单位B */
|
||||
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */
|
||||
"imageCompressEnable": true, /* 是否压缩图片,默认是true */
|
||||
"imageCompressBorder": 800, /* 图片压缩最大宽度限制 */
|
||||
"imageInsertAlign": "none", /* 插入的图片浮动方式 */
|
||||
"imageUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"imagePathFormat": "/userfiles/{userid}/images/{yyyy}{mm}{dd}/{filename}_${time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
|
||||
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
|
||||
/* {time} 会替换成时间戳 */
|
||||
/* {yyyy} 会替换成四位年份 */
|
||||
/* {yy} 会替换成两位年份 */
|
||||
/* {mm} 会替换成两位月份 */
|
||||
/* {dd} 会替换成两位日期 */
|
||||
/* {hh} 会替换成两位小时 */
|
||||
/* {ii} 会替换成两位分钟 */
|
||||
/* {ss} 会替换成两位秒 */
|
||||
/* 非法字符 \ : * ? " < > | */
|
||||
/* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
|
||||
|
||||
/* 涂鸦图片上传配置项 */
|
||||
"scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */
|
||||
"scrawlFieldName": "upfile", /* 提交的图片表单名称 */
|
||||
"scrawlPathFormat": "/userfiles/{userid}/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B */
|
||||
"scrawlUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"scrawlInsertAlign": "none",
|
||||
|
||||
/* 截图工具上传 */
|
||||
"snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */
|
||||
"snapscreenPathFormat": "/userfiles/{userid}/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"snapscreenUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */
|
||||
|
||||
/* 抓取远程图片配置 */
|
||||
"catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"],
|
||||
"catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */
|
||||
"catcherFieldName": "source", /* 提交的图片列表表单名称 */
|
||||
"catcherPathFormat": "/userfiles/{userid}/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"catcherUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"catcherMaxSize": 2048000, /* 上传大小限制,单位B */
|
||||
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */
|
||||
|
||||
/* 上传视频配置 */
|
||||
"videoActionName": "uploadvideo", /* 执行上传视频的action名称 */
|
||||
"videoFieldName": "upfile", /* 提交的视频表单名称 */
|
||||
"videoPathFormat": "/userfiles/{userid}/videos/{yyyy}{mm}{dd}/{filename}_${time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"videoUrlPrefix": "", /* 视频访问路径前缀 */
|
||||
"videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */
|
||||
"videoAllowFiles": [
|
||||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
|
||||
".ogg", ".ogv", ".mov", ".wmv", ".mp4",".m4v", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */
|
||||
|
||||
/* 上传文件配置 */
|
||||
"fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */
|
||||
"fileFieldName": "upfile", /* 提交的文件表单名称 */
|
||||
"filePathFormat": "/userfiles/{userid}/files/{yyyy}{mm}{dd}/{filename}_${time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
|
||||
"fileUrlPrefix": "", /* 文件访问路径前缀 */
|
||||
"fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */
|
||||
"fileAllowFiles": [
|
||||
".png", ".jpg", ".jpeg", ".gif", ".bmp",
|
||||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
|
||||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
|
||||
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
|
||||
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
|
||||
], /* 上传文件格式显示 */
|
||||
|
||||
/* 列出指定目录下的图片 */
|
||||
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
|
||||
"imageManagerListPath": "/userfiles/{userid}/images/", /* 指定要列出图片的目录 */
|
||||
"imageManagerListSize": 100, /* 每次列出文件数量 */
|
||||
"imageManagerUrlPrefix": "", /* 图片访问路径前缀 */
|
||||
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
|
||||
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */
|
||||
|
||||
/* 列出指定目录下的文件 */
|
||||
"fileManagerActionName": "listfile", /* 执行文件管理的action名称 */
|
||||
"fileManagerListPath": "/userfiles/{userid}/files/", /* 指定要列出文件的目录 */
|
||||
"fileManagerListSize": 100, /* 每次列出文件数量 */
|
||||
"fileManagerUrlPrefix": "", /* 文件访问路径前缀 */
|
||||
"fileManagerAllowFiles": [
|
||||
".png", ".jpg", ".jpeg", ".gif", ".bmp",
|
||||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
|
||||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
|
||||
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
|
||||
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
|
||||
] /* 列出的文件类型 */
|
||||
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
|
||||
<display-name>JeeSite</display-name>
|
||||
|
||||
<!-- Context Param -->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath*:spring/spring-context.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- Web Context Listener -->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- CAS Session Listener -->
|
||||
<listener>
|
||||
<listener-class>com.jeesite.common.shiro.cas.CasOutSessionListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Request Context Listener -->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Encoding Filter -->
|
||||
<filter>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>forceEncoding</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- PageCache Filter, cache .html suffix.
|
||||
<filter>
|
||||
<filter-name>PageCacheFilter</filter-name>
|
||||
<filter-class>com.jeesite.common.web.PageCachingFilter</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
<init-param>
|
||||
<param-name>cacheName</param-name>
|
||||
<param-value>pageCachingFilter</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>PageCacheFilter</filter-name>
|
||||
<url-pattern>*.html</url-pattern>
|
||||
</filter-mapping> -->
|
||||
|
||||
<!-- Apache Shiro Filter -->
|
||||
<filter>
|
||||
<filter-name>shiroFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
<init-param>
|
||||
<param-name>targetFilterLifecycle</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>shiroFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<!-- Request Context Filter 需要放在shiroFilter后,否则request获取不到session -->
|
||||
<filter>
|
||||
<filter-name>requestContextFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>requestContextFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Spring MVC Servlet -->
|
||||
<servlet>
|
||||
<servlet-name>webMvcServlet</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath*:/spring/spring-mvc.xml</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
<async-supported>true</async-supported>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>webMvcServlet</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- Druid StatView
|
||||
<servlet>
|
||||
<servlet-name>DruidStatView</servlet-name>
|
||||
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
|
||||
<async-supported>true</async-supported>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>DruidStatView</servlet-name>
|
||||
<url-pattern>/druid/*</url-pattern>
|
||||
</servlet-mapping>-->
|
||||
|
||||
<!-- Druid WebStatFilter
|
||||
<filter>
|
||||
<filter-name>DruidWebStatFilter</filter-name>
|
||||
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
<init-param>
|
||||
<param-name>exclusions</param-name>
|
||||
<param-value>*.css,*.js,*.png,*.jpg,*.gif,*.jpeg,*.bmp,*.ico,*.swf,*.psd,*.htc,*.htm,*.html,*.crx,*.xpi,*.exe,*.ipa,*.apk,*.otf,*.eot,*.svg,*.ttf,*.woff</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>DruidWebStatFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>-->
|
||||
|
||||
<!-- FineReport Servlet
|
||||
<servlet>
|
||||
<servlet-name>ReportServer</servlet-name>
|
||||
<servlet-class>com.fr.web.ReportServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>ReportServer</servlet-name>
|
||||
<url-pattern>/ReportServer</url-pattern>
|
||||
</servlet-mapping>-->
|
||||
|
||||
<!-- Apache CXF Servlet
|
||||
<servlet>
|
||||
<servlet-name>CXFServlet</servlet-name>
|
||||
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>CXFServlet</servlet-name>
|
||||
<url-pattern>/services/*</url-pattern>
|
||||
</servlet-mapping>-->
|
||||
|
||||
<!-- FoxBPM Restlet Servlet
|
||||
<servlet>
|
||||
<servlet-name>FoxbpmRestletServlet</servlet-name>
|
||||
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>org.restlet.application</param-name>
|
||||
<param-value>com.jeesite.modules.foxbpm.rest.FlowRestApplication</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>FoxbpmRestletServlet</servlet-name>
|
||||
<url-pattern>/foxbpm/service/*</url-pattern>
|
||||
</servlet-mapping>-->
|
||||
|
||||
<!-- Error page -->
|
||||
<error-page>
|
||||
<error-code>500</error-code>
|
||||
<location>/error/500</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<error-code>404</error-code>
|
||||
<location>/error/404</location>
|
||||
</error-page>
|
||||
|
||||
</web-app>
|
||||
@@ -4,15 +4,17 @@
|
||||
package com.jeesite.test;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Commit;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
import com.jeesite.config.Application;
|
||||
|
||||
/**
|
||||
* 初始化核心表数据
|
||||
* @author ThinkGem
|
||||
* @version 2017-10-22
|
||||
*/
|
||||
@ContextConfiguration(locations={"classpath*:/spring/spring-context-test.xml"})
|
||||
@SpringBootTest(classes=Application.class)
|
||||
@Commit
|
||||
public class InitCoreData extends com.jeesite.modules.db.InitCoreData {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user