springboot2-thymeleaf 사용 예제를 다룬 코드를 참고한다.


https://www.mkyong.com/spring-boot/spring-boot-hello-world-example-thymeleaf/



실수하기 좋은 부분은 다음과 같다. 


1. html 파일에 다음을 추가해야 한다.

<html lang="ko" xmlns:th="http://www.thymeleaf.org">


2. th를 잘 사용한다.

velocity에서 아래와 같이 사용했다면..

  <span class="item">${link.itemName}</span>


아래와 같이 th:text를 사용한다.

<span class="item" th:text="${link.itemName}"></span>



3, 

velocity에서 아래와 같이 사용했다면..


    <span class="image" style="background-image:url(${link.thumbnail})"></span>


아래와 같이 th:style과 콜럼을 잘 사용해야 한다. 실수하기 가장 쉬운 곳이 아래 빨간색 색칠한 부분이다.

<span class="image" th:style="'background-image:url(' + ${link. thumbnail} + ');'"></span>


Posted by '김용환'
,


list/set/dict comprehension 예시



# list comprehension
print([x for x in range(5)])

print([x*2 for x in range(5) if x != 1])

print(["You are good, " + x for x in ["Zero, Jonathan"]])

#결과
#[0, 1, 2, 3, 4]
#[0, 4, 6, 8]
#['You are good, Zero, Jonathan']

# set comprehension

print({"You are good, " + x for x in ["Zero, Zero"]})

# 결과
# {'You are good, Zero, Zero'}

# dictionary comprehension
score = [('merlin', 90), ('zero', 80), ('samuel', 95)]
print({x[0]: x[1] for x in score})

# 결과
# {'merlin': 90, 'zero': 80, 'samuel': 95}


# generator expression
gen = (x+1 for x in range(5))
print(gen)
print(next(gen))
print(next(gen))
print(next(gen))

# 결과
# <generator object <genexpr> at 0x103721570>
# 1
# 2
# 3


여기에 sum을 사용해 lambda 처럼 비슷하게 사용할 수 있다. 

print([1 for x in range(5)])
#[1, 1, 1, 1, 1]

print(sum([1 for x in range(5)]))
#5


Posted by '김용환'
,


어벤져스 엔드게임 중에 좋았던 대사


Thor's mother: A failure? Absolutely. 

                         실패라고 한다면 맞지. 완전히 실패했지. 


Thor : That's a little bit harsh. 

           너무 막말하시네요. 어머니. 


Thor's mother: Do you know what that makes you? Just like everyone else.

                       그 실패가 무엇을 알려준 줄 아니? 그저 다른 사람과 같아지는 것일 뿐이야. 


Thor : I'm not supposed to be like everyone else, am I? 

          내가 대단한 뭔가가 될 수 없다는 의미인가요. 제가요?


Thor's mother: Everyone fails at who they're supposed to be, Thor. The measure of a person a hero is how well they succeed at being who they are. 

                        모든 사람은 되고 싶은 뭔가에 되는 걸 실패한단다. 토르..

                        히어로의 척도는 스스로 얼마나 자신의 존재로서 성공하느냐에 달려있단다.


'영화를 보고' 카테고리의 다른 글

"아름다운 것들은 관심을 바라지 않지"  (0) 2018.11.21
[더스토리] 영화의 기억나는 대사  (0) 2018.06.26
레디 플레이어 원  (0) 2018.04.04
칠드런 오브 맨  (0) 2016.10.25
[마이크롭 앤 가솔린]  (0) 2016.07.02
Posted by '김용환'
,



spring boot2  (Spring Framework 5)부터 지원하지 않는 게 있다..



https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-5.x#removed-packages-classes-and-methods


Dropped support: Portlet, Velocity, JasperReports, XMLBeans, JDO, Guava.

Recommendation: Stay on Spring Framework 4.3.x for those if needed.


Posted by '김용환'
,


JPA 개발을 편리하게 해주는 querydsl 라이브러리는 2018년 중순 개발이 멈췄고,

querydsl 의 gradle 라이브러리는 조심스럽게 써야 한다. querydsl gradle 개발회사인 ewerk가 망하면서.. 자연스럽게 개발이 멈춰졌다. 



https://github.com/ewerk/gradle-plugins


EWERK Gradle Plugins

NOTE: The plugins are currently not compatible to Gradle 5+ and have not been tested with a JDK higher than 1.8. Currently a lot of issues arise related to using the plugins with Gradle 5+. There are plans to adopt the plugins to the newest Gradle API but time is lacking. Help is pretty much appreciated. Please see https://github.com/ewerk/gradle-plugins/milestone/1.



jdk 10+, gradle 5+를 써도 컴파일되긴 한다... 다만 안정성은 보장 못하니.. 조심하게 사용할 필요가 있다. 


Posted by '김용환'
,


springboot 에서 아래와 같은 에러가 발생한다면.


Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.




다음과 같이 드라이브 클래스 이름부터 제대로 추가했는지 확인하다.



spring.datasource.driver-class-name: com.mysql.jdbc.Driver
spring.datasource...
....



Posted by '김용환'
,
Posted by '김용환'
,