전체 글
-
spring method argumentResolvers (controller 파라미터 맵핑)IT/spring 2021. 2. 8. 16:10
@Configuration @EnableWebMvc @EnableConfigurationProperties(ProjectProperties.class) @EnableScheduling @EnableTransactionManagement public class ApiWebMvcConfigurerAdapter implements WebMvcConfigurer { ... @Override public void addArgumentResolvers(List argumentResolvers) { argumentResolvers.add(new HandlerMethodArgumentResolver() { @Override public boolean supportsParameter(MethodParameter para..
-
spring 다국어처리 2가지 session, Accept-LanguageIT/spring 2021. 2. 8. 16:02
session @Configuration @EnableConfigurationProperties(ProjectProperties.class) public class CmsWebMvcConfigurerAdapter implements WebMvcConfigurer { ... @Bean public LocaleResolver localeResolver() { SessionLocaleResolver slr = new SessionLocaleResolver(); slr.setDefaultLocale(Locale.US); return slr; } public LocaleChangeInterceptor localeChangeInterceptor() { LocaleChangeInterceptor lci = new L..
-
logback 5분 마다 logfile 생성하기IT/spring 2021. 2. 5. 12:41
안녕하세요고객사의 요청으로 5분마다 logfile을 남겨야할 상황이 있어서 공유합니다. logback.xml log/%d{yyyyMMdd, aux}/${serviceName}.%d{yyyyMMddHHmm}.log @Component public class FiveMinAppender extends RollingFileAppender { public static ProjectProperties projectProperties; private static long nextMillis = -1; private int rollOverTimeInMinutes = 5; @Autowired public void setProjectProperties(ProjectProperties projectProperties) {..
-
spring boot swagger settingIT/spring 2021. 2. 5. 12:13
@Configuration @EnableSwagger2 public class SwaggerConfig { @Value("${project.properties.swagger-host}") private String swaggerHost; @Autowired ServerProperties serverProperties; @Autowired private TypeResolver typeResolver; @Bean public Docket api(TypeResolver typeResolver) { ResolvedRecursiveType resolvedRecursiveType = new ResolvedRecursiveType(Integer.class, null); Optional typeInt = Optiona..
-
java 자바 이미지 텍스트 변환하기IT 2021. 2. 5. 12:11
이미지 텍스트 변환하기~~ 장군아~~~~~ 왕손아~~~~~ File img = new File("d:\\003376810.jpg"); BufferedImage b = ImageUtil.getImage(img); for (int i = 0; i < b.getHeight(); i+=1) { for (int y = 0; y < b.getWidth(); y+=1) { Color g = new Color(b.getRGB(y, i)); Color ll = new Color(20, 20, 20); Color l = new Color(50, 50, 50); Color m = new Color(100, 100, 100); Color mm = new Color(150, 150, 150); Color h = new Colo..
-
spring boot oaauth2.0 (링크 정리 공유)IT/spring 2021. 2. 4. 15:43
안녕하세요oauth2.0정리 및 링크 공유 합니다.참고할만한 링크 공유합니다. http://www.baeldung.com/rest-api-spring-oauth2-angularjs https://github.com/Baeldung/spring-security-oauth/tree/master/spring-security-oauth-server/src http://projects.spring.io/spring-security-oauth/docs/oauth2.html https://www.javacodegeeks.com/2015/10/spring-boot-oauth2-security.html https://www.javacodegeeks.com/2015/10/spring-boot-oauth2-security...
-
spring boot 정리 (locale, messageSource, security, jpa, hibernate, Scheduler, config)IT/spring 2021. 2. 4. 15:43
안녕하세요 Spring boot 정리 해봅니다. https://github.com/visualkhh/lib-spring/tree/master/boot/default_template visualkhh@gmail.com springboot로 만든 기본틀입니다. 사용 : spring jpa, hibernate, scheduler, config, groovyTemplate //설명은 소스안 주석으로 설명하겠습니다. build.gradlegroup 'com.boot' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'idea' apply plugin: 'spring-boot' apply plugin: 'war' apply plugin: 'groovy' ver..
-
페이징(Paging) 계산 ClassIT/java 2021. 2. 4. 15:42
public class Page { String name;// 이름 //user setting var int itemTotalCount= 0;//아이템크기 intpageItemCount= 10;//페이지에 한번에 보여줄 아이템크기 int pageCount= 1;//페이지수 보여줄 개수 //user chioce var int currentItem= 1;//현재 아이템 번호 public Page() { } public Page(String name) { this.name=name; } public Page(String name, int itemTotalCount, int pageItemCount, int pageCount, int currentItem) { setName(name); setItemTotalC..