This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<beans:beans xmlns="http://www.springframework.org/schema/security" | |
xmlns:beans="http://www.springframework.org/schema/beans" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/security | |
http://www.springframework.org/schema/security/spring-security-3.2.xsd | |
http://www.springframework.org/schema/context | |
http://www.springframework.org/schema/context/spring-context-3.2.xsd" default-lazy-init="false"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-server -XX:PermSize=64M -XX:MaxPermSize=128m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cn.boxiao.bxn.common.boot; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.support.AbstractBeanFactory; | |
import org.springframework.stereotype.Component; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'4','绘画',NULL,'7','4'); | |
'3','音乐',NULL,'7','3'); | |
'9','其他',NULL,'7','9'); | |
'1','唱歌',NULL,'7','1'); | |
'8','书法',NULL,'7','8'); | |
'5','篮球',NULL,'7','5'); | |
'6','排球',NULL,'7','6'); | |
'2','电脑',NULL,'7','2'); | |
'7','摄影',NULL,'7','7'); | |
'1','一般',NULL,'8','1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> | |
<property name="username" value="root"/> | |
<property name="password" value="123456"/> | |
<property name="driverClass" value="com.mysql.jdbc.Driver"/> | |
<property name="url" value="jdbc:mysql://localhost:3306/test_bxn?useUnicode=true&characterEncoding=UTF-8"/> | |
</bean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.sql.Sql | |
import org.dbunit.database.DatabaseConnection; | |
import org.dbunit.database.IDatabaseConnection; | |
import org.dbunit.dataset.IDataSet; | |
import org.dbunit.dataset.xml.FlatXmlDataSet; | |
import org.dbunit.operation.DatabaseOperation; | |
buildscript { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample.uic.web.controller; | |
import sample.uic.model.Organization; | |
import sample.uic.model.OrganizationUser; | |
import sample.uic.model.User; | |
import sample.uic.service.OrganizationService; | |
import sample.uic.service.UserService; | |
import com.google.common.collect.Lists; | |
import org.junit.Before; | |
import org.junit.Test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@InitBinder | |
protected void initBinder(HttpServletRequest request, | |
ServletRequestDataBinder binder) { | |
SimpleDateFormat dateFormat = | |
new SimpleDateFormat("yyyy-MM-dd"); | |
dateFormat.setLenient(false); | |
binder.registerCustomEditor(Date.class, null, | |
new CustomDateEditor(dateFormat, true)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int count = 0; | |
int maxTries = 3; | |
while(true) { | |
try { | |
// Some Code | |
// break out of loop, on success | |
} catch (SomeException e) { | |
// handle exception | |
if (++count == maxTries) throw e; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mvc:annotation-driven conversion-service="conversionService" ignoreDefaultModelOnRedirect="true"> | |
<mvc:argument-resolvers> | |
<bean class="org.springframework.data.web.PageableArgumentResolver"/> | |
</mvc:argument-resolvers> | |
</mvc:annotation-driven> | |
<bean class="org.springframework.data.repository.support.DomainClassConverter"> | |
<constructor-arg ref="conversionService"/> | |
</bean> |