Java/Spring Framework(4)
-
Thymeleaf 문법
일반적인 css 참조 문법 타임리프에서 css 참조 문법 일반적인 js 참조 문법 타임리프에서 js 참조 문법 참고 문서 : Standard URL Syntax - Thymeleaf The Thymeleaf standard dialects –called Standard and SpringStandard– offer a way to easily create URLs in your web applications so that they include any required URL preparation artifacts. This is done by means of the so-called link expressions, a type www.thymeleaf.org
2024.03.16 -
java.net.URLDecoder
JS단에서 JSON.stringify() 에 의해 문자열화된 키, 값 쌍을 JSP Controller 로 받을 때 개발자의 의도와 상관없이 %20Key1=%??Value1&Key2=Value2& ... 처럼 사이사이에 %20 같은 Escape 문자가 들어 있을 때가 있다. 이것은 UTF-8 (유니코드 구현 방식 중 하나) 환경에서 긴 한글 텍스트가 포함되어 있을 때 발생한다. 이것은 Java 에서 URLDecoder.decode(문자열, "utf-8"); 을 써서 인코딩 이전의 상태로 풀어 낼 수 있다.
2023.10.30 -
스프링 부트 2.4.1
스프링 부트(이하, 부트)는 스프링 프레임워크를 보다 쉽게 접근할 수 있도록 (하려고) 만들어 놓은 몸통이다. 스프링 프레임워크가 자잘한 기능을 지닌 라이브러리를 독립적으로 분리해놓은 결과물이라면 부트는 그것들을 유기적으로 엮어서 더 큰 덩어리로 묶은 것이다. 스프링 프레임워크와 마찬가지로 부트도 start.spring.io/ (Spring Initializer 서비스)를 통해 maven, gradle 로 작업할 수 있게 프로젝트 파일을 만들어 준다. 요즘 자바인들의 90%가 쓰고 있다는 IntelliJ 에서도 이것을 응용해서 프로젝트 마법사에서 더욱 편하게 활용할 수 있게 만들었다. File -> New -> Project .. -> Spring Initilizer 가 바로 그것이다. start.spr..
2023.04.05 -
RedisTemplate - Spring 에서 \xaa 문자 안들어가게 하는 방법
DefaultSerializer 를 치환해서 UTF-8 대신 US-ASCII (US 알파벳과 숫자만으로 깔끔하게) 인코딩으로 변환 : 변경 전 - 현상 : "redisTemplate.setDefaultSerializer(new StringRedisSerializer());" 를 썼을 땐 UTF-8 인코딩 변환에 의해 원치 않는 결과가 들어감. 최종 코드 : @Bean(name = "template") public RedisTemplate redisTemplateConfig(JedisConnectionFactory jedisConnectionFactory) { RedisTemplate redisTemplate = new RedisTemplate(); redisTemplate.setDefaultSeriali..
2023.04.05